You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by wa...@apache.org on 2025/05/21 17:29:22 UTC
(echarts) branch fix/tooltip/cleanup-styleCoord-markers created (now 78727051d)
This is an automated email from the ASF dual-hosted git repository.
wangzx pushed a change to branch fix/tooltip/cleanup-styleCoord-markers
in repository https://gitbox.apache.org/repos/asf/echarts.git
at 78727051d fix(tooltip): fix style coord transform markers are not removed after the tooltip is disposed
This branch includes the following new commits:
new 78727051d fix(tooltip): fix style coord transform markers are not removed after the tooltip is disposed
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org
(echarts) 01/01: fix(tooltip): fix style coord transform markers are not removed after the tooltip is disposed
Posted by wa...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
wangzx pushed a commit to branch fix/tooltip/cleanup-styleCoord-markers
in repository https://gitbox.apache.org/repos/asf/echarts.git
commit 78727051d9d8d16829fec1830df56a0b98453d07
Author: plainheart <yh...@all-my-life.cn>
AuthorDate: Thu May 22 01:28:45 2025 +0800
fix(tooltip): fix style coord transform markers are not removed after the tooltip is disposed
---
src/component/tooltip/TooltipHTMLContent.ts | 22 ++++++++++++++++------
1 file changed, 16 insertions(+), 6 deletions(-)
diff --git a/src/component/tooltip/TooltipHTMLContent.ts b/src/component/tooltip/TooltipHTMLContent.ts
index f03bcd8f1..6bc72919c 100644
--- a/src/component/tooltip/TooltipHTMLContent.ts
+++ b/src/component/tooltip/TooltipHTMLContent.ts
@@ -227,7 +227,7 @@ function makeStyleCoord(
const zrViewportRoot = zrPainter && zrPainter.getViewportRoot();
if (zrViewportRoot) {
// Some APPs might use scale on body, so we support CSS transform here.
- transformLocalCoord(out, zrViewportRoot, container, zrX, zrY);
+ return transformLocalCoord(out, zrViewportRoot, container, zrX, zrY);
}
}
else {
@@ -265,6 +265,7 @@ class TooltipHTMLContent {
private _show: boolean = false;
private _styleCoord: [number, number, number, number] = [0, 0, 0, 0];
+ private _styleCoordCleanups: ReturnType<typeof makeStyleCoord>;
private _enterable = true;
private _zr: ZRenderType;
@@ -307,7 +308,9 @@ class TooltipHTMLContent {
: isFunction(appendTo) && appendTo(api.getDom())
);
- makeStyleCoord(this._styleCoord, zr, container, api.getWidth() / 2, api.getHeight() / 2);
+ this._styleCoordCleanups = makeStyleCoord(
+ this._styleCoord, zr, container, api.getWidth() / 2, api.getHeight() / 2
+ );
(container || api.getDom()).appendChild(el);
@@ -471,7 +474,7 @@ class TooltipHTMLContent {
return;
}
const styleCoord = this._styleCoord;
- makeStyleCoord(styleCoord, this._zr, this._container, zrX, zrY);
+ this._styleCoordCleanups = makeStyleCoord(styleCoord, this._zr, this._container, zrX, zrY);
if (styleCoord[0] != null && styleCoord[1] != null) {
const style = this.el.style;
@@ -528,9 +531,16 @@ class TooltipHTMLContent {
clearTimeout(this._hideTimeout);
clearTimeout(this._longHideTimeout);
- const parentNode = this.el.parentNode;
- parentNode && parentNode.removeChild(this.el);
- this.el = this._container = null;
+ each(this._styleCoordCleanups, function (cleanup) {
+ cleanup();
+ });
+
+ if (this.el) {
+ const parentNode = this.el.parentNode;
+ parentNode && parentNode.removeChild(this.el);
+ }
+
+ this._styleCoordCleanups = this.el = this._container = null;
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org