Commit 1bde4de8 by Alex Khomenko Committed by GitHub

Grafana UI: Unbind graph only if initialised (#25762)

parent 46df05fd
...@@ -70,8 +70,10 @@ export class Graph extends PureComponent<GraphProps, GraphState> { ...@@ -70,8 +70,10 @@ export class Graph extends PureComponent<GraphProps, GraphState> {
} }
componentWillUnmount() { componentWillUnmount() {
if (this.$element) {
this.$element.unbind('plotselected', this.onPlotSelected); this.$element.unbind('plotselected', this.onPlotSelected);
} }
}
onPlotSelected = (event: JQueryEventObject, ranges: { xaxis: { from: number; to: number } }) => { onPlotSelected = (event: JQueryEventObject, ranges: { xaxis: { from: number; to: number } }) => {
const { onHorizontalRegionSelected } = this.props; const { onHorizontalRegionSelected } = this.props;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment