File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -76,6 +76,7 @@ const Tooltip = ({
7676 const tooltipShowDelayTimerRef = useRef < NodeJS . Timeout | null > ( null )
7777 const tooltipHideDelayTimerRef = useRef < NodeJS . Timeout | null > ( null )
7878 const missedTransitionTimerRef = useRef < NodeJS . Timeout | null > ( null )
79+ const tooltipShowTimerRef = useRef < NodeJS . Timeout | null > ( null )
7980 const [ computedPosition , setComputedPosition ] = useState < IComputedPosition > ( {
8081 tooltipStyles : { } ,
8182 tooltipArrowStyles : { } ,
@@ -194,7 +195,8 @@ const Tooltip = ({
194195 * wait for the component to render and calculate position
195196 * before actually showing
196197 */
197- setTimeout ( ( ) => {
198+ clearTimeoutRef ( tooltipShowTimerRef )
199+ tooltipShowTimerRef . current = setTimeout ( ( ) => {
198200 if ( ! mounted . current ) {
199201 return
200202 }
@@ -348,6 +350,9 @@ const Tooltip = ({
348350 border,
349351 arrowSize,
350352 } ) . then ( ( computedStylesData ) => {
353+ if ( ! mounted . current ) {
354+ return
355+ }
351356 handleComputedPosition ( computedStylesData )
352357 } )
353358 }
@@ -803,6 +808,7 @@ const Tooltip = ({
803808 return ( ) => {
804809 clearTimeoutRef ( tooltipShowDelayTimerRef )
805810 clearTimeoutRef ( tooltipHideDelayTimerRef )
811+ clearTimeoutRef ( tooltipShowTimerRef )
806812 }
807813 } , [ ] )
808814
You can’t perform that action at this time.
0 commit comments