File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -515,8 +515,10 @@ const Tooltip = ({
515515
516516 const enabledEvents : { event : string ; listener : ( event ?: Event ) => void } [ ] = [ ]
517517
518+ const activeAnchorContainsTarget = ( event ?: Event ) : boolean =>
519+ Boolean ( event ?. target && activeAnchor ?. contains ( event . target as HTMLElement ) )
518520 const handleClickOpenTooltipAnchor = ( event ?: Event ) => {
519- if ( show && event ?. target === activeAnchor ) {
521+ if ( show && activeAnchorContainsTarget ( event ) ) {
520522 /**
521523 * ignore clicking the anchor that was used to open the tooltip.
522524 * this avoids conflict with the click close event.
@@ -526,7 +528,7 @@ const Tooltip = ({
526528 handleShowTooltip ( event )
527529 }
528530 const handleClickCloseTooltipAnchor = ( event ?: Event ) => {
529- if ( ! show || event ?. target !== activeAnchor ) {
531+ if ( ! show || ! activeAnchorContainsTarget ( event ) ) {
530532 /**
531533 * ignore clicking the anchor that was NOT used to open the tooltip.
532534 * this avoids closing the tooltip when clicking on a
You can’t perform that action at this time.
0 commit comments