MCPcopy Create free account
hub / github.com/bvaughn/react-window / checkForScrollEnd

Function checkForScrollEnd

lib/hooks/useIsScrolling.ts:50–57  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

48
49 // Timeouts can be starved while scrolling (see issue #106), so check the elapsed time each frame instead
50 const checkForScrollEnd = () => {
51 if (performance.now() - lastScrollTime >= delay) {
52 animationFrameId = undefined;
53 setIsScrolling(false);
54 } else {
55 animationFrameId = ownerWindow.requestAnimationFrame(checkForScrollEnd);
56 }
57 };
58
59 const onScroll = () => {
60 setIsScrolling(true);

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected