Skip to content

Commit

Permalink
Fixed #16673, labels in treeGrid were not destroyed after an update.
Browse files Browse the repository at this point in the history
  • Loading branch information
karolkolodziej committed Dec 9, 2021
1 parent d88ad82 commit 99b76c0
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
7 changes: 7 additions & 0 deletions samples/unit-tests/gantt/treegrid/demo.js
Expand Up @@ -516,4 +516,11 @@ QUnit.test('series.data[].collapsed', assert => {
false,
'This point should be expanded #13838'
);

chart.series[0].setData([], true, true, false);
assert.notOk(
document.querySelector('.highcharts-label-icon'),
`After updating data,
the unnecessary label icons should be removed, 16673.`
);
});
12 changes: 12 additions & 0 deletions ts/Core/Axis/TreeGridTick.ts
Expand Up @@ -466,6 +466,18 @@ namespace TreeGridTick {
}
}

/**
* Destroy remaining labelIcon if exist.
*
* @private
* @function Highcharts.Tick#destroy
*/
public destroy(): void {
if (this.labelIcon) {
this.labelIcon.destroy();
}
}

/**
* Expand the grid cell. Used when axis is of type treegrid.
*
Expand Down

0 comments on commit 99b76c0

Please sign in to comment.