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

Function onResize

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

Source from the content-addressed store, hash-verified

350 useLayoutEffect(() => {
351 let timeout: ReturnType<typeof setTimeout>;
352 let onResize = () => {
353 isResizing.current = true;
354 clearTimeout(timeout);
355
356 timeout = setTimeout(() => {
357 isResizing.current = false;
358 }, 500);
359
360 updatePosition();
361 };
362
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.

Callers 1

onScrollFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected