Skip to content

Commit

Permalink
fix(tooltip): Hide tooltip on redraw when unexpected error
Browse files Browse the repository at this point in the history
Fix getting element from non numeric coordinate value,
otherwise hide tooltip

Fix #3909
Close #3910
  • Loading branch information
alanhamlett authored and netil committed Nov 15, 2024
1 parent 587d71e commit 3540640
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
3 changes: 2 additions & 1 deletion AUTHORS.txt
Original file line number Diff line number Diff line change
Expand Up @@ -67,4 +67,5 @@ nekoya <[email protected]>
Ubin Park <https://github.com/Ubinquitous>
William Nolden <[email protected]>
Sergiu Statache <[email protected]>
vlaforet <[email protected]>
vlaforet <[email protected]>
Alan Hamlett <[email protected]>
9 changes: 4 additions & 5 deletions src/ChartInternal/internals/tooltip.ts
Original file line number Diff line number Diff line change
Expand Up @@ -657,14 +657,13 @@ export default {
$$.setExpand(idx, null, true);
}
}

// for Arc & Treemap
} else {
} else { // for Arc & Treemap
const {clientX, clientY} = event;

setTimeout(() => {
let target = document.elementFromPoint(clientX, clientY);
const data = d3Select(target).datum() as IArcData;
let target = [clientX, clientY].every(Number.isFinite) &&
document.elementFromPoint(clientX, clientY);
const data = target && d3Select(target).datum() as IArcData;

if (data) {
const d = $$.hasArcType() ?
Expand Down

0 comments on commit 3540640

Please sign in to comment.