Skip to content

Commit

Permalink
fix: ignore delayShow if tooltip is already rendered
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrieljablonski committed Feb 10, 2024
1 parent 6d01157 commit 3727065
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/components/Tooltip/Tooltip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,12 @@ const Tooltip = ({
clearTimeout(tooltipShowDelayTimerRef.current)
}

if (rendered) {
// if the tooltip is already rendered, ignore delay
handleShow(true)
return
}

tooltipShowDelayTimerRef.current = setTimeout(() => {
handleShow(true)
}, delay)
Expand Down

0 comments on commit 3727065

Please sign in to comment.