File tree 1 file changed +4
-2
lines changed
1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -515,8 +515,10 @@ const Tooltip = ({
515
515
516
516
const enabledEvents : { event : string ; listener : ( event ?: Event ) => void } [ ] = [ ]
517
517
518
+ const activeAnchorContainsTarget = ( event ?: Event ) : boolean =>
519
+ Boolean ( event ?. target && activeAnchor ?. contains ( event . target as HTMLElement ) )
518
520
const handleClickOpenTooltipAnchor = ( event ?: Event ) => {
519
- if ( show && event ?. target === activeAnchor ) {
521
+ if ( show && activeAnchorContainsTarget ( event ) ) {
520
522
/**
521
523
* ignore clicking the anchor that was used to open the tooltip.
522
524
* this avoids conflict with the click close event.
@@ -526,7 +528,7 @@ const Tooltip = ({
526
528
handleShowTooltip ( event )
527
529
}
528
530
const handleClickCloseTooltipAnchor = ( event ?: Event ) => {
529
- if ( ! show || event ?. target !== activeAnchor ) {
531
+ if ( ! show || ! activeAnchorContainsTarget ( event ) ) {
530
532
/**
531
533
* ignore clicking the anchor that was NOT used to open the tooltip.
532
534
* this avoids closing the tooltip when clicking on a
You can’t perform that action at this time.
0 commit comments