From 6f8934fe5905c681be763b6918b982a80bf2b7e8 Mon Sep 17 00:00:00 2001 From: Jackson Harper Date: Tue, 4 Apr 2023 22:21:10 +0800 Subject: [PATCH] Reset throttle timeout after clearing, fixes issue where scroll watcher doesnt fire --- packages/web/lib/hooks/useScrollWatcher.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/web/lib/hooks/useScrollWatcher.tsx b/packages/web/lib/hooks/useScrollWatcher.tsx index af47493f3..619625aca 100644 --- a/packages/web/lib/hooks/useScrollWatcher.tsx +++ b/packages/web/lib/hooks/useScrollWatcher.tsx @@ -40,6 +40,7 @@ export function useScrollWatcher(effect: Effect, delay: number): void { return () => { if (throttleTimeout.current) { clearTimeout(throttleTimeout.current) + throttleTimeout.current = undefined } window.removeEventListener('scroll', handleScroll) }