Skip to content

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 dynatrace-oss#579
  • Loading branch information
tomheller authored and Yngrid Coello committed Nov 9, 2020
1 parent 8d36d39 commit 084151a
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 084151a

Please sign in to comment.