When a keyboard appears, iOS and Android both attempt to resize or reposition the WebView automatically. If your web app is already full-height and manages keyboard avoidance in JavaScript, this native adjustment creates a white gap below the keyboard and disrupts your layout. TheDocumentation Index
Fetch the complete documentation index at: https://setup.despia.com/llms.txt
Use this file to discover all available pages before exploring further.
preventdefault://autoscroll scheme disables that native behavior and lets you opt back in at any time.
Installation
- Bundle
- CDN
How it works
Callpreventdefault://autoscroll with enabled=false to stop the native layer from moving the WebView when the keyboard opens. Call with enabled=true to restore the default behavior.
Disable on app load
The most common pattern is to disable native keyboard resizing once on startup, before any input is focused. This ensures the WebView never shifts position during the session.Selectively re-enable for specific inputs
If one part of your app relies on native scroll behavior - such as a form that does not manage its own keyboard avoidance - you can toggle the mode per interaction.Platform behavior
The scheme maps to different native APIs on each platform but produces the same result - the WebView holds its position when the keyboard appears.| Parameter | iOS | Android |
|---|---|---|
?enabled=false | contentInsetAdjustmentBehavior = .never - WebView stays put | SOFT_INPUT_ADJUST_NOTHING - window does not resize |
?enabled=true | contentInsetAdjustmentBehavior = .automatic - native behavior restored | SOFT_INPUT_ADJUST_RESIZE - native behavior restored |
Resources
NPM Package
despia-native