Primitives / foldkit-primitives/dom

keyboardInset

function · packages/primitives/src/dom/keyboard-inset.ts:20

function keyboardInset(view: {
  readonly innerHeight: number
  readonly visualViewport: {
    readonly height: number
    readonly offsetTop: number
    readonly scale: number
  } | null
}): number

The part of the layout viewport's height below the visual viewport: what the on-screen keyboard covers. Rounded down, since a fraction of a pixel of zoom is no keyboard. While the page is pinch-zoomed in (scale above 1) the visual viewport is short because it shows less of the page, not because something covers it, so nothing is reported.