Primitives / foldkit-primitives/dom

KeyboardInset

const · packages/primitives/src/dom/keyboard-inset.ts:35

const KeyboardInset: Mount.MountDefinitionWithArgs<'KeyboardInset', {}, never>

The on-screen keyboard's height as a Mount, with no Message and no Model: where it is is the browser's. iOS Safari, and Chrome on Android unless the page asks otherwise, leave the layout viewport as it is when the keyboard opens, so a panel fixed to the screen keeps its height and its bottom under the keys. This writes KEYBOARD_INSET on the element, from the visual viewport's size and scroll, for a style to pad or shrink by (var(--fk-keyboard-inset, 0px)), and removes it when the element goes. Where there is no visual viewport it writes nothing.