Fix: Fancy scrollbars (#18151)

* Fix: Fancy scrollbars

* Fix: Fancy scrollbars
pull/18166/head
Zoe Steinkamp 2020-05-18 18:40:40 -06:00 committed by GitHub
parent b3037680f8
commit d5b3ccb6f0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 11 deletions

View File

@ -1,7 +1,7 @@
import * as React from 'react' import * as React from 'react'
import CellMeasurerCacheDecorator from './CellMeasurerCacheDecorator' import CellMeasurerCacheDecorator from './CellMeasurerCacheDecorator'
import {Grid} from 'react-virtualized' import {Grid} from 'react-virtualized'
import {DapperScrollbars} from '@influxdata/clockface' import {DapperScrollbars, FusionScrollEvent} from '@influxdata/clockface'
const SCROLLBAR_SIZE_BUFFER = 20 const SCROLLBAR_SIZE_BUFFER = 20
type HeightWidthFunction = (arg: {index: number}) => number type HeightWidthFunction = (arg: {index: number}) => number
@ -401,9 +401,8 @@ class MultiGrid extends React.PureComponent<PropsMultiGrid, State> {
return this.topGridHeight return this.topGridHeight
} }
private onScrollbarsScroll = (e: React.MouseEvent<HTMLElement>) => { private onScrollbarsScroll = (e: FusionScrollEvent) => {
const {target} = e this.onScroll(e)
this.onScroll(target)
} }
private onScroll = scrollInfo => { private onScroll = scrollInfo => {

View File

@ -1,11 +1,11 @@
// Libraries // Libraries
import React, {PureComponent, MouseEvent} from 'react' import React, {PureComponent} from 'react'
import memoizeOne from 'memoize-one' import memoizeOne from 'memoize-one'
import RawFluxDataGrid from 'src/timeMachine/components/RawFluxDataGrid' import RawFluxDataGrid from 'src/timeMachine/components/RawFluxDataGrid'
// Utils // Utils
import {parseFiles} from 'src/timeMachine/utils/rawFluxDataTable' import {parseFiles} from 'src/timeMachine/utils/rawFluxDataTable'
import {DapperScrollbars} from '@influxdata/clockface' import {DapperScrollbars, FusionScrollEvent} from '@influxdata/clockface'
interface Props { interface Props {
files: string[] files: string[]
@ -58,11 +58,8 @@ class RawFluxDataTable extends PureComponent<Props, State> {
) )
} }
private onScrollbarsScroll = (e: MouseEvent<HTMLElement>) => { private onScrollbarsScroll = (e: FusionScrollEvent) => {
e.preventDefault() const {scrollTop, scrollLeft} = e
e.stopPropagation()
const {scrollTop, scrollLeft} = e.currentTarget
this.setState({scrollLeft, scrollTop}) this.setState({scrollLeft, scrollTop})
} }