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

Function onScroll

packages/react-aria/src/overlays/useOverlayPosition.ts:365–369  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

363 // Only reposition the overlay if a scroll event happens immediately as a result of resize (aka the virtual keyboard has appears)
364 // We don't want to reposition the overlay if the user has pinch zoomed in and is scrolling the viewport around.
365 let onScroll = () => {
366 if (isResizing.current) {
367 onResize();
368 }
369 };
370
371 visualViewport?.addEventListener('resize', onResize);
372 visualViewport?.addEventListener('scroll', onScroll);

Callers

nothing calls this directly

Calls 1

onResizeFunction · 0.70

Tested by

no test coverage detected