Experimental: This is an experimental technology
Check the Browser compatibility table carefully before using this in production.
The VirtualKeyboard
interface of the VirtualKeyboard API is useful on devices that have on-screen virtual keyboards, such as tablets, mobile phones, or other devices where a hardware keyboard may not be available.
The VirtualKeyboard
interface makes it possible to opt out of the automatic way browsers handle on-screen virtual keyboards by reducing the height of the viewport to make room for the virtual keyboard. You can prevent the browser from changing the size of the viewport, detect the position and size of the virtual keyboard — adapting the layout of your web page as a follow-up — and programmatically show or hide the virtual keyboard.
You access the VirtualKeyboard
interface by using navigator.virtualKeyboard
.