File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -56,6 +56,7 @@ const Tooltip = ({
56
56
const { anchorRefs, setActiveAnchor : setProviderActiveAnchor } = useTooltip ( id )
57
57
const hoveringTooltip = useRef ( false )
58
58
const [ anchorsBySelect , setAnchorsBySelect ] = useState < HTMLElement [ ] > ( [ ] )
59
+ const mounted = useRef ( false )
59
60
60
61
useEffect ( ( ) => {
61
62
let selector = anchorSelect
@@ -73,7 +74,6 @@ const Tooltip = ({
73
74
setAnchorsBySelect ( [ ] )
74
75
}
75
76
} , [ anchorSelect ] )
76
- const mounted = useRef ( false )
77
77
78
78
/**
79
79
* useLayoutEffect runs before useEffect,
@@ -92,6 +92,8 @@ const Tooltip = ({
92
92
/**
93
93
* this fixes weird behavior when switching between two anchor elements very quickly
94
94
* remove the timeout and switch quickly between two adjancent anchor elements to see it
95
+ *
96
+ * in practice, this means the tooltip is not immediately removed from the DOM on hide
95
97
*/
96
98
const timeout = setTimeout ( ( ) => {
97
99
setRendered ( false )
@@ -268,11 +270,9 @@ const Tooltip = ({
268
270
if ( anchorById ?. contains ( event . target as HTMLElement ) ) {
269
271
return
270
272
}
271
-
272
273
if ( anchorsBySelect . some ( ( anchor ) => anchor . contains ( event . target as HTMLElement ) ) ) {
273
274
return
274
275
}
275
-
276
276
handleShow ( false )
277
277
}
278
278
You can’t perform that action at this time.
0 commit comments