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 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
@ -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 => {

View File

@ -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[]
@ -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})
}