Skip to content

Commit 274ed4c

Browse files
JacobBrandtthomasneirynck
JacobBrandt
authored andcommitted
Destroy charts before the layout removes them from the DOM (#9728)
Closes #9696
1 parent a8ae8a7 commit 274ed4c

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/ui/public/vis_maps/maps.js

+6
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,12 @@ export default function MapsFactory(Private) {
8484
}
8585

8686
draw() {
87+
// Destroy the charts before they get removed from the DOM on the new
88+
// layout render.
89+
if(this.charts !== undefined) {
90+
this.charts.forEach(chart => chart.destroy());
91+
}
92+
8793
this.layout.render();
8894
// todo: title
8995
const self = this;

0 commit comments

Comments
 (0)