Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions src/components/Tooltip/Tooltip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -477,13 +477,20 @@ 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) {
/**
* same reasoning as above, opposite logic.
*/
return
}
handleHideTooltip()
Expand Down