diff --git a/src/components/Tooltip/Tooltip.tsx b/src/components/Tooltip/Tooltip.tsx index 3f3b8641..396f574c 100644 --- a/src/components/Tooltip/Tooltip.tsx +++ b/src/components/Tooltip/Tooltip.tsx @@ -477,13 +477,21 @@ const Tooltip = ({ const enabledEvents: { event: string; listener: (event?: Event) => void }[] = [] const handleClickOpenTooltipAnchor = (event?: Event) => { - if (show) { + if (show && event?.target === activeAnchor) { + /** + * ignore clicking the anchor that was used to open the tooltip. + * this avoids conflict with the click close event. + */ return } handleShowTooltip(event) } - const handleClickCloseTooltipAnchor = () => { - if (!show) { + const handleClickCloseTooltipAnchor = (event?: Event) => { + if (!show || event?.target !== activeAnchor) { + /** + * ignore clicking the anchor that was NOT used to open the tooltip. + * this avoids closing the tooltip when clicking on a new anchor with the tooltip already open. + */ return } handleHideTooltip()