Skip to content

Commit

Permalink
fix: fix the error in custom tooltip handler in big-screen
Browse files Browse the repository at this point in the history
  • Loading branch information
zamhown authored and skie1997 committed Mar 6, 2024
1 parent fb2a92f commit 3ed10fb
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions packages/vchart/src/component/tooltip/tooltip.ts
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ export class Tooltip extends BaseComponent<any> implements ITooltip {
return;
}

const browserEnv = isTrueBrowser(this._option.mode);
const browserEnv = isTrueBrowser(this._option?.mode);
const { clientX, clientY } = params.event as MouseEvent;

// 当 enterable 为 true,同时鼠标移入 tooltip 时 pointerleave 事件也会触发,所以这里做一个判断
Expand Down Expand Up @@ -526,7 +526,10 @@ export class Tooltip extends BaseComponent<any> implements ITooltip {
}

private _isPointerInChart(point: IPoint): boolean {
const globalInstance = this._option.globalInstance;
const globalInstance = this._option?.globalInstance;
if (!globalInstance) {
return false;
}
const chart = globalInstance.getChart();
if (!chart) {
return false;
Expand Down

0 comments on commit 3ed10fb

Please sign in to comment.