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 = ({
171
171
if ( ! event ) {
172
172
return
173
173
}
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
+ }
174
184
if ( delayShow ) {
175
185
handleShowTooltipDelayed ( )
176
186
} else {
177
187
handleShow ( true )
178
188
}
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 } )
182
191
183
192
if ( tooltipHideDelayTimerRef . current ) {
184
193
clearTimeout ( tooltipHideDelayTimerRef . current )
You can’t perform that action at this time.
0 commit comments