Skip to content

Commit

Permalink
[ML] stop handler on mount
Browse files Browse the repository at this point in the history
  • Loading branch information
darnautov committed Jul 17, 2020
1 parent bcf13a3 commit dec9d6c
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

import React from 'react';
import './_explorer.scss';
import _, { isEqual } from 'lodash';
import _, { isEqual, throttle } from 'lodash';
import d3 from 'd3';
import moment from 'moment';
import DragSelect from 'dragselect';
Expand Down Expand Up @@ -204,6 +204,8 @@ export class ExplorerSwimlane extends React.Component<ExplorerSwimlaneProps> {
});

this.renderSwimlane();

this.dragSelect.stop();
}

componentDidUpdate() {
Expand Down Expand Up @@ -735,14 +737,16 @@ export class ExplorerSwimlane extends React.Component<ExplorerSwimlaneProps> {
}
}

throttledSetSwimLaneActive = throttle(this.setSwimlaneSelectActive, 500);

render() {
const { swimlaneType } = this.props;

return (
<div
className="mlExplorerSwimlane"
onMouseEnter={this.setSwimlaneSelectActive.bind(this, true)}
onMouseLeave={this.setSwimlaneSelectActive.bind(this, false)}
onMouseEnter={this.throttledSetSwimLaneActive.bind(this, true)}
onMouseLeave={this.throttledSetSwimLaneActive.bind(this, false)}
data-test-subj={this.props['data-test-subj'] ?? null}
>
<div
Expand Down

0 comments on commit dec9d6c

Please sign in to comment.