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 @@ -517,8 +517,10 @@ const Tooltip = ({
517517
518518 const enabledEvents : { event : string ; listener : ( event ?: Event ) => void } [ ] = [ ]
519519
520+ const activeAnchorContainsTarget = ( event ?: Event ) : boolean =>
521+ Boolean ( event ?. target && activeAnchor ?. contains ( event . target as HTMLElement ) )
520522 const handleClickOpenTooltipAnchor = ( event ?: Event ) => {
521- if ( show && event ?. target === activeAnchor ) {
523+ if ( show && activeAnchorContainsTarget ( event ) ) {
522524 /**
523525 * ignore clicking the anchor that was used to open the tooltip.
524526 * this avoids conflict with the click close event.
@@ -528,7 +530,7 @@ const Tooltip = ({
528530 handleShowTooltip ( event )
529531 }
530532 const handleClickCloseTooltipAnchor = ( event ?: Event ) => {
531- if ( ! show || event ?. target !== activeAnchor ) {
533+ if ( ! show || ! activeAnchorContainsTarget ( event ) ) {
532534 /**
533535 * ignore clicking the anchor that was NOT used to open the tooltip.
534536 * this avoids closing the tooltip when clicking on a
You can’t perform that action at this time.
0 commit comments