Skip to content

Commit

Permalink
fix(tooltip): fix potential NPE when setting option with notMerge s…
Browse files Browse the repository at this point in the history
…trategy (#20435)

* fix: tooltip hove issue on rerender

* fix: use ternary instead of optional chaining

* fix: eslint issue

* remove: unwanted invoke
  • Loading branch information
ktx-abhay authored Oct 23, 2024
1 parent 3277f98 commit ecebf65
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/component/tooltip/TooltipHTMLContent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -461,10 +461,13 @@ class TooltipHTMLContent {

getSize() {
const el = this.el;
return [el.offsetWidth, el.offsetHeight];
return el ? [el.offsetWidth, el.offsetHeight] : [0, 0];
}

moveTo(zrX: number, zrY: number) {
if (!this.el) {
return;
}
const styleCoord = this._styleCoord;
makeStyleCoord(styleCoord, this._zr, this._container, zrX, zrY);

Expand Down

0 comments on commit ecebf65

Please sign in to comment.