File tree Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -171,14 +171,23 @@ const Tooltip = ({
171171 if ( ! event ) {
172172 return
173173 }
174+ const target = ( event . currentTarget ?? event . target ) as HTMLElement | null
175+ if ( ! target ?. isConnected ) {
176+ /**
177+ * this happens when the target is removed from the DOM
178+ * at the same time the tooltip gets triggered
179+ */
180+ setActiveAnchor ( null )
181+ setProviderActiveAnchor ( { current : null } )
182+ return
183+ }
174184 if ( delayShow ) {
175185 handleShowTooltipDelayed ( )
176186 } else {
177187 handleShow ( true )
178188 }
179- const target = event . currentTarget ?? event . target
180- setActiveAnchor ( target as HTMLElement )
181- setProviderActiveAnchor ( { current : target as HTMLElement } )
189+ setActiveAnchor ( target )
190+ setProviderActiveAnchor ( { current : target } )
182191
183192 if ( tooltipHideDelayTimerRef . current ) {
184193 clearTimeout ( tooltipHideDelayTimerRef . current )
You can’t perform that action at this time.
0 commit comments