Skip to content
Snippets Groups Projects
Commit 4e778936 authored by Kyle Doherty's avatar Kyle Doherty Committed by GitHub
Browse files

hide action popover when scrolling data table (#5442)

* hide action popover when scrolling data table

* flow

* add instance method for action hiding
parent 3919e0e1
Branches
Tags
No related merge requests found
......@@ -31,6 +31,7 @@ type Props = VisualizationProps & {
height: number,
sort: any,
isPivoted: boolean,
onActionDismissal: () => void
}
type State = {
columnWidths: number[],
......@@ -362,7 +363,10 @@ export default class TableInteractive extends Component {
rowCount={rows.length}
rowHeight={ROW_HEIGHT}
cellRenderer={this.cellRenderer}
onScroll={({ scrollLeft }) => onScroll({ scrollLeft })}
onScroll={({ scrollLeft }) => {
this.props.onActionDismissal()
return onScroll({ scrollLeft })}
}
scrollLeft={scrollLeft}
tabIndex={null}
overscanRowCount={20}
......
......@@ -242,6 +242,10 @@ export default class Visualization extends Component {
this.setState({ error })
}
hideActions = () => {
this.setState({ clicked: null })
}
render() {
const { actionButtons, className, showTitle, isDashboard, width, height, errorIcon, isSlow, expectedDuration, replacementContent } = this.props;
const { series, CardVisualization } = this.state;
......@@ -396,6 +400,7 @@ export default class Visualization extends Component {
visualizationIsClickable={this.visualizationIsClickable}
onRenderError={this.onRenderError}
onRender={this.onRender}
onActionDismissal={this.hideActions}
gridSize={gridSize}
onChangeCardAndRun={this.props.onChangeCardAndRun ? this.handleOnChangeCardAndRun : null}
/>
......@@ -409,7 +414,7 @@ export default class Visualization extends Component {
clicked={clicked}
clickActions={clickActions}
onChangeCardAndRun={this.handleOnChangeCardAndRun}
onClose={() => this.setState({ clicked: null })}
onClose={this.hideActions}
/>
}
</div>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment