Skip to content
This repository was archived by the owner on Jun 3, 2024. It is now read-only.

Commit 5c8a3cd

Browse files
committed
more complete purge on new DOM element creation
1 parent a92ac35 commit 5c8a3cd

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/components/Graph.react.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,10 @@ class PlotlyGraph extends Component {
106106

107107
// in case we've made a new DOM element, transfer events
108108
if(this._hasPlotted && gd !== this._prevGd) {
109-
this._prevGd.removeAllListeners();
109+
if(this._prevGd && this._prevGd.removeAllListeners) {
110+
this._prevGd.removeAllListeners();
111+
Plotly.purge(this._prevGd);
112+
}
110113
this._hasPlotted = false;
111114
}
112115

0 commit comments

Comments
 (0)