diff --git a/src/ScrollBar.tsx b/src/ScrollBar.tsx index 01b9d69..dcfe1e1 100644 --- a/src/ScrollBar.tsx +++ b/src/ScrollBar.tsx @@ -193,6 +193,9 @@ const ScrollBar = React.forwardRef((props, ref) => React.useEffect(() => { delayHidden(); + return () => { + clearTimeout(visibleTimeoutRef.current); + }; }, [scrollOffset]); // ====================== Imperative ======================