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

Function getTouchScreen

packages/react-aria/src/utils/keyboard.tsx:123–134  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

121}
122
123function getTouchScreen(): TouchScreen {
124 // Normalize the screen by any scaling to get the layout coordinate space.
125 let screenWidth = Number(window.visualViewport?.width ?? window.innerWidth);
126 let screenHeight = Number(window.visualViewport?.height ?? window.innerHeight);
127 let visualScale = Number(window.visualViewport?.scale ?? 1);
128
129 return {
130 width: screenWidth * visualScale,
131 height: screenHeight * visualScale,
132 angle: window.screen.orientation.angle
133 };
134}
135
136function onResizeStart(e: Event): void {
137 // So we don't constantly call clearTimeout and setTimeout, keep track of the

Callers 4

onResizeEndFunction · 0.85
onOrientationChangeFunction · 0.85
onFocusFunction · 0.85
setupGlobalEventsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected