diff --git a/webpack/ForemanTasks/Components/Chart/Chart.js b/webpack/ForemanTasks/Components/Chart/Chart.js index bb4df516b..14d0e1ff2 100644 --- a/webpack/ForemanTasks/Components/Chart/Chart.js +++ b/webpack/ForemanTasks/Components/Chart/Chart.js @@ -38,7 +38,12 @@ class C3Chart extends React.Component { destroyChart() { try { - this.chart = this.chart.destroy(); + // A workaround for a case, where the chart might be still in transition + // phase while unmounting/destroying - destroying right away leads + // to issue described in https://github.com/bcbcarl/react-c3js/issues/22. + // Delaying the destroy a bit seems to resolve the issue. + setTimeout(this.chart.destroy, 1000); + this.chart = null; } catch (err) { throw new Error('Internal C3 error', err); }