Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Commit

Permalink
fix(chart): Fixes an issue where the tooltip stayed open when the chart
Browse files Browse the repository at this point in the history
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
  • Loading branch information
tomheller committed Feb 13, 2020
1 parent 6e4a2e1 commit 395fa44
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions components/chart/src/chart.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 395fa44

Please sign in to comment.