Skip to content

Commit

Permalink
[ML] Remove DragSelect event handlers and selectors on the swim lane …
Browse files Browse the repository at this point in the history
…unmount (#72250)

* [ML] remove selector element on unmount

* [ML] stop handler on mount

* [ML] remove throttling
  • Loading branch information
darnautov committed Jul 17, 2020
1 parent 2913fef commit 60f7126
Showing 1 changed file with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -204,18 +204,20 @@ export class ExplorerSwimlane extends React.Component<ExplorerSwimlaneProps> {
});

this.renderSwimlane();

this.dragSelect.stop();
}

componentDidUpdate() {
this.renderSwimlane();
}

componentWillUnmount() {
if (this.dragSelectSubscriber !== null) {
this.dragSelectSubscriber.unsubscribe();
}
const element = d3.select(this.rootNode.current!);
element.html('');
this.dragSelectSubscriber!.unsubscribe();
// Remove selector element from DOM
this.dragSelect.selector.remove();
// removes all mousedown event handlers
this.dragSelect.stop(true);
}

selectCell(cellsToSelect: any[], { laneLabels, bucketScore, times }: SelectedData) {
Expand Down

0 comments on commit 60f7126

Please sign in to comment.