diff --git a/src/component/tooltip/TooltipView.ts b/src/component/tooltip/TooltipView.ts index 2d259799ac..11d965f8ec 100644 --- a/src/component/tooltip/TooltipView.ts +++ b/src/component/tooltip/TooltipView.ts @@ -243,6 +243,12 @@ class TooltipView extends ComponentView { const api = this._api; const triggerOn = tooltipModel.get('triggerOn'); + if (tooltipModel.get('trigger') !== 'axis') { + // _lastDataByCoordSys and _cbParamsList are used for axis tooltip only. + this._lastDataByCoordSys = null; + this._cbParamsList = null; + } + // Try to keep the tooltip show when refreshing if (this._lastX != null && this._lastY != null @@ -393,6 +399,7 @@ class TooltipView extends ComponentView { } this._lastX = this._lastY = this._lastDataByCoordSys = null; + this._cbParamsList = null; if (payload.from !== this.uid) { this._hide(makeDispatchAction(payload, api)); @@ -468,6 +475,7 @@ class TooltipView extends ComponentView { return; } this._lastDataByCoordSys = null; + this._cbParamsList = null; let seriesDispatcher: Element; let cmptDispatcher: Element; @@ -501,6 +509,7 @@ class TooltipView extends ComponentView { } else { this._lastDataByCoordSys = null; + this._cbParamsList = null; this._hide(dispatchAction); } } @@ -1027,6 +1036,7 @@ class TooltipView extends ComponentView { // FIXME // duplicated hideTip if manuallyHideTip is called from dispatchAction. this._lastDataByCoordSys = null; + this._cbParamsList = null; dispatchAction({ type: 'hideTip', from: this.uid @@ -1040,6 +1050,11 @@ class TooltipView extends ComponentView { clear(this, '_updatePosition'); this._tooltipContent.dispose(); globalListener.unregister('itemTooltip', api); + + this._tooltipContent = null; + this._tooltipModel = null; + this._lastDataByCoordSys = null; + this._cbParamsList = null; } } diff --git a/test/runTest/actions/__meta__.json b/test/runTest/actions/__meta__.json index 10f3d0937f..5007121e4a 100644 --- a/test/runTest/actions/__meta__.json +++ b/test/runTest/actions/__meta__.json @@ -220,6 +220,7 @@ "tooltip-domnode": 1, "tooltip-event": 1, "tooltip-link": 2, + "tooltip-refresh": 1, "tooltip-rich": 1, "tooltip-setOption": 2, "tooltip-valueFormatter": 3, diff --git a/test/runTest/actions/tooltip-refresh.json b/test/runTest/actions/tooltip-refresh.json new file mode 100644 index 0000000000..cddc6fab13 --- /dev/null +++ b/test/runTest/actions/tooltip-refresh.json @@ -0,0 +1 @@ +[{"name":"Action 1","ops":[{"type":"mousemove","time":454,"x":481,"y":259},{"type":"mousemove","time":654,"x":492,"y":263},{"type":"mousedown","time":717,"x":492,"y":263},{"type":"mouseup","time":823,"x":492,"y":263},{"time":824,"delay":2200,"type":"screenshot-auto"}],"scrollY":0,"scrollX":0,"timestamp":1737531200147}] \ No newline at end of file diff --git a/test/tooltip-refresh.html b/test/tooltip-refresh.html new file mode 100644 index 0000000000..9bc9e156a6 --- /dev/null +++ b/test/tooltip-refresh.html @@ -0,0 +1,120 @@ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +