Skip to content

Commit 123976e

Browse files
authored
Merge pull request #20987 from apache/fix/tooltip/cleanup-styleCoord-markers
fix(tooltip): fix style coord transform markers are not removed after the tooltip is disposed
2 parents 4ea877a + 43dd693 commit 123976e

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/component/tooltip/TooltipHTMLContent.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
import { isString, indexOf, each, bind, isFunction, isArray, isDom, retrieve2 } from 'zrender/src/core/util';
2121
import { normalizeEvent } from 'zrender/src/core/event';
22-
import { transformLocalCoord } from 'zrender/src/core/dom';
22+
import { transformLocalCoord, transformLocalCoordClear } from 'zrender/src/core/dom';
2323
import env from 'zrender/src/core/env';
2424
import { convertToColorString, toCamelCase, normalizeCssArray } from '../../util/format';
2525
import type ExtensionAPI from '../../core/ExtensionAPI';
@@ -550,8 +550,14 @@ class TooltipHTMLContent {
550550
clearTimeout(this._hideTimeout);
551551
clearTimeout(this._longHideTimeout);
552552

553-
const parentNode = this.el.parentNode;
554-
parentNode && parentNode.removeChild(this.el);
553+
const zr = this._zr;
554+
transformLocalCoordClear(zr && zr.painter && zr.painter.getViewportRoot(), this._container);
555+
556+
if (this.el) {
557+
const parentNode = this.el.parentNode;
558+
parentNode && parentNode.removeChild(this.el);
559+
}
560+
555561
this.el = this._container = null;
556562
}
557563

0 commit comments

Comments
 (0)