From 0ed1f1c4d5f1fd4b7036bb026772627793e3bbf9 Mon Sep 17 00:00:00 2001 From: Thomas Heller Date: Wed, 12 Feb 2020 09:52:51 +0100 Subject: [PATCH] fix(chart): Fixes an issue where the tooltip stayed open when the chart was destroyed. Fire the tooltipClose event when the chart is destroyed, so any open tooltip will close when the parent chart component is destroyed. Fixes #579 --- components/chart/src/chart.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/components/chart/src/chart.ts b/components/chart/src/chart.ts index 3795b399ac..af4cbadd0e 100644 --- a/components/chart/src/chart.ts +++ b/components/chart/src/chart.ts @@ -459,6 +459,11 @@ export class DtChart } ngOnDestroy(): void { + // Next and complete the highChartsTooltipClosed observable + // to clear off any tooltips, that would still be open. + this._highChartsTooltipClosed$.next(); + this._highChartsTooltipClosed$.complete(); + this._destroy$.next(); this._destroy$.complete(); if (this._chartObject) {