Skip to content

Commit 9661e98

Browse files
authored
Merge pull request #844 from ReactTooltip/clear-timeout-show-delay
Always clear the show delay timeout when handling hide events
2 parents acaa612 + eac50b8 commit 9661e98

File tree

2 files changed

+2
-8
lines changed

2 files changed

+2
-8
lines changed

src/components/Tooltip/Tooltip.tsx

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -82,14 +82,8 @@ const Tooltip = ({
8282
handleShow(false)
8383
}
8484

85-
if (show && tooltipShowDelayTimerRef.current) {
85+
if (tooltipShowDelayTimerRef.current) {
8686
clearTimeout(tooltipShowDelayTimerRef.current)
87-
} else if (!show && tooltipShowDelayTimerRef.current) {
88-
// workaround to prevent tooltip being show forever
89-
// when we remove the mouse before show tooltip with `delayShow`
90-
tooltipHideDelayTimerRef.current = setTimeout(() => {
91-
handleShow(false)
92-
}, delayShow * 2)
9387
}
9488
}
9589

src/components/TooltipController/TooltipController.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ const TooltipController = ({
9393
const parsedEvents = value.split(' ')
9494
setTooltipEvents(parsedEvents as EventsType[])
9595
},
96-
positionStrategy: (value: PositionStrategy) => {
96+
'position-strategy': (value: PositionStrategy) => {
9797
setTooltipPositionStrategy(value)
9898
},
9999
'delay-show': (value: number) => {

0 commit comments

Comments
 (0)