Skip to content

Commit ec02ff0

Browse files
fix: reset stale refs
1 parent 0121022 commit ec02ff0

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Diff for: src/components/Tooltip/Tooltip.tsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ const Tooltip = ({
7373
// warning was already issued in the controller
7474
setAnchorsBySelect([])
7575
}
76-
}, [anchorSelect])
76+
}, [anchorSelect, activeAnchor])
7777

7878
/**
7979
* useLayoutEffect runs before useEffect,
@@ -360,6 +360,7 @@ const Tooltip = ({
360360
return [...mutation.removedNodes].some((node) => {
361361
if (node.contains(activeAnchor)) {
362362
handleShow(false)
363+
setActiveAnchor(null)
363364
return true
364365
}
365366
return false

0 commit comments

Comments
 (0)