Skip to content

Commit

Permalink
fix: watch for delayShow/delayHide changes
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrieljablonski committed Feb 10, 2024
1 parent 3727065 commit e48db29
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/components/Tooltip/Tooltip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -635,6 +635,8 @@ const Tooltip = ({
closeEvents,
globalCloseEvents,
shouldOpenOnClick,
delayShow,
delayHide,
])

useEffect(() => {
Expand Down Expand Up @@ -806,6 +808,13 @@ const Tooltip = ({
}
}, [id, anchorSelect, imperativeOptions?.anchorSelect])

useEffect(() => {
if (tooltipShowDelayTimerRef.current) {
clearTimeout(tooltipShowDelayTimerRef.current)
handleShowTooltipDelayed(delayShow)
}
}, [delayShow])

const actualContent = imperativeOptions?.content ?? content
const canShow = show && Object.keys(inlineStyles).length > 0

Expand Down

0 comments on commit e48db29

Please sign in to comment.