Skip to content

Commit

Permalink
Fix: Fancy scrollbars (#18151)
Browse files Browse the repository at this point in the history
* Fix: Fancy scrollbars

* Fix: Fancy scrollbars
  • Loading branch information
zoesteinkamp authored May 19, 2020
1 parent b303768 commit d5b3ccb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 11 deletions.
7 changes: 3 additions & 4 deletions ui/src/shared/components/MultiGrid/MultiGrid.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as React from 'react'
import CellMeasurerCacheDecorator from './CellMeasurerCacheDecorator'
import {Grid} from 'react-virtualized'
import {DapperScrollbars} from '@influxdata/clockface'
import {DapperScrollbars, FusionScrollEvent} from '@influxdata/clockface'

const SCROLLBAR_SIZE_BUFFER = 20
type HeightWidthFunction = (arg: {index: number}) => number
Expand Down Expand Up @@ -401,9 +401,8 @@ class MultiGrid extends React.PureComponent<PropsMultiGrid, State> {
return this.topGridHeight
}

private onScrollbarsScroll = (e: React.MouseEvent<HTMLElement>) => {
const {target} = e
this.onScroll(target)
private onScrollbarsScroll = (e: FusionScrollEvent) => {
this.onScroll(e)
}

private onScroll = scrollInfo => {
Expand Down
11 changes: 4 additions & 7 deletions ui/src/timeMachine/components/RawFluxDataTable.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
// Libraries
import React, {PureComponent, MouseEvent} from 'react'
import React, {PureComponent} from 'react'
import memoizeOne from 'memoize-one'
import RawFluxDataGrid from 'src/timeMachine/components/RawFluxDataGrid'

// Utils
import {parseFiles} from 'src/timeMachine/utils/rawFluxDataTable'
import {DapperScrollbars} from '@influxdata/clockface'
import {DapperScrollbars, FusionScrollEvent} from '@influxdata/clockface'

interface Props {
files: string[]
Expand Down Expand Up @@ -58,11 +58,8 @@ class RawFluxDataTable extends PureComponent<Props, State> {
)
}

private onScrollbarsScroll = (e: MouseEvent<HTMLElement>) => {
e.preventDefault()
e.stopPropagation()

const {scrollTop, scrollLeft} = e.currentTarget
private onScrollbarsScroll = (e: FusionScrollEvent) => {
const {scrollTop, scrollLeft} = e

this.setState({scrollLeft, scrollTop})
}
Expand Down

0 comments on commit d5b3ccb

Please sign in to comment.