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

Function onResize

packages/react-aria/src/utils/useViewportSize.ts:41–48  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

39
40 // Use visualViewport api to track available height even on iOS virtual keyboard opening
41 let onResize = () => {
42 // Ignore updates when zoomed.
43 if (visualViewport && visualViewport.scale > 1) {
44 return;
45 }
46
47 updateSize(getViewportSize());
48 };
49
50 // When closing the keyboard, WebKit on iOS does not fire the visual viewport resize event until the animation is complete.
51 // We can anticipate this and resize early by handling the blur event and using the layout size.

Callers 2

useTableColumnResizeFunction · 0.50
ControlledTableResizingFunction · 0.50

Calls 2

updateSizeFunction · 0.85
getViewportSizeFunction · 0.85

Tested by

no test coverage detected