cats-charts 0.0.93 → 0.0.94

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -6551,9 +6551,12 @@ class GanttChart {
6551
6551
  if (this.horizontalZoomLayoutFrame) {
6552
6552
  cancelAnimationFrame(this.horizontalZoomLayoutFrame);
6553
6553
  }
6554
- if (this.chartInstance) {
6554
+ // ngx-echarts can dispose the ECharts instance before this component's
6555
+ // destroy hook runs. A disposed instance no longer has a ZRender surface,
6556
+ // so do not try to remove the wheel listener from it.
6557
+ if (this.chartInstance && !this.chartInstance.isDisposed()) {
6555
6558
  if (this.zoomWheelHandler) {
6556
- this.chartInstance.getZr().off('mousewheel', this.zoomWheelHandler);
6559
+ this.chartInstance.getZr()?.off('mousewheel', this.zoomWheelHandler);
6557
6560
  }
6558
6561
  this.chartInstance.off();
6559
6562
  this.chartInstance.dispose();