()
| 9 | } |
| 10 | |
| 11 | const getVisualViewport = (): VisualViewportResult => ({ |
| 12 | width: globalThis?.window?.visualViewport?.width ?? 0, |
| 13 | height: globalThis?.window?.visualViewport?.height ?? 0, |
| 14 | // iOS scrolls the layout viewport under the keyboard rather than resizing it, |
| 15 | // so a fixed overlay has to be pushed down by this much to stay on screen. |
| 16 | offsetTop: globalThis?.window?.visualViewport?.offsetTop ?? 0, |
| 17 | // Pinch-zoom shrinks the visual viewport too; only scale tells it apart |
| 18 | // from a keyboard. |
| 19 | scale: globalThis?.window?.visualViewport?.scale ?? 1, |
| 20 | }); |
| 21 | |
| 22 | /** |
| 23 | * @param enabled subscribe to viewport changes. Pass `false` from consumers |
nothing calls this directly
no outgoing calls
no test coverage detected