Skip to content

Commit

Permalink
fix: fix hide of tooltip when viewbox is smaller than canvas
Browse files Browse the repository at this point in the history
  • Loading branch information
xile611 committed Oct 24, 2024
1 parent 7d63723 commit 8dde0cb
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/vchart/src/component/tooltip/tooltip.ts
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ export class Tooltip extends BaseComponent<any> implements ITooltip {
this._mountEvent('pointerdown', { source: 'chart' }, this._getMouseMoveHandler(false));
this._mountEvent('pointerup', { source: 'window' }, this._getMouseOutHandler(true));
}
this._mountEvent('pointerout', { source: 'canvas' }, this._getMouseOutHandler(false));
this._mountEvent('pointerleave', { source: 'chart' }, this._getMouseOutHandler(false));
}
if (trigger.includes('click')) {
this._mountEvent('pointertap', { source: 'chart' }, this._getMouseMoveHandler(true));
Expand Down Expand Up @@ -469,6 +469,7 @@ export class Tooltip extends BaseComponent<any> implements ITooltip {
if (isClick && this._spec.lockAfterClick && !this._clickLock) {
this._clickLock = true;
} else if (Number.isFinite(this._spec.hideTimer)) {
// hover 事件,设置默认的定时器,避免out事件不触发的问题
this._hideTimer = setTimeout(() => {
this._handleChartMouseOut();
}, this._spec.hideTimer as number) as unknown as number;
Expand Down

0 comments on commit 8dde0cb

Please sign in to comment.