MCPcopy Create free account
hub / github.com/adobe/react-spectrum / onScroll

Function onScroll

packages/dev/s2-docs/src/client.tsx:331–336  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

329// Save scroll position to history state when scrolling stops.
330let scrollSaveTimeout: ReturnType<typeof setTimeout> | null = null;
331function onScroll() {
332 if (scrollSaveTimeout) {
333 clearTimeout(scrollSaveTimeout);
334 }
335 scrollSaveTimeout = setTimeout(saveScrollPosition, 150);
336}
337
338window.addEventListener('scroll', onScroll, {passive: true, capture: true});
339

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected