Repository navigation
Description
Description
The VirtualKeyboard API gives web apps fine-grained control when the on-screen keyboard appears, without relying on UA viewport resizing heuristics. It exposes:
navigator.virtualKeyboard.overlaysContent to opt out of automatic viewport adjustments,
geometrychange events plus boundingRect for keyboard geometry,
CSS env variables like env(keyboard-inset-height) to adapt layout purely with CSS.
This is critical for chat/messaging UIs, editors, and PWAs where input bars, FABs, or sticky footers are routinely occluded or cause scroll-jank. Aligning behavior across engines will remove a long-standing mobile web pain point and reduce site-specific workarounds. See MDN and Chrome docs for conceptual overview and examples.
MDN Web Docs
Chrome for Developers
Why now? Many complex apps (chat, editors, spreadsheets) still ship UA-specific hacks to avoid occlusion when the virtual keyboard appears. Interop on this API (events + CSS env vars + opt-out switch) would significantly reduce breakage and improve user experience across Android, iOS/iPadOS, ChromeOS, and desktop touch devices. (See references above.)
Specification
web-feature
Test Links
WPT live sample: virtual-keyboard/virtual-keyboard-type.https.html (checks navigator.virtualKeyboard type) — https://wpt.live/virtual-keyboard/virtual-keyboard-type.https.html
wpt.live
WPT directory (VirtualKeyboard API & policy tests) — reference: https://chromium.googlesource.com/.../wpt/+/refs/tags/epochs/daily/2024-06-09_01H/virtual-keyboard/
(contains tentative tests run with --enable-features=VirtualKeyboard)
Additional Signals
Shipping status (Chromium): Available since Chromium 94 on desktop & mobile (feature detection via navigator.virtualKeyboard).
Chrome for Developers
Mozilla standards-position: “Virtual Keyboard Control” discussion (tracking issue).
GitHub
WebKit: Request for position thread (2021) and WebKit bug tracking “Implement the VirtualKeyboard API”.
lists.webkit.org
WebKit Bugzilla
Spec maturity: W3C Web Editing WG Working Draft.
W3C
Problem background / developer pain points: MDN overview; in-depth article on fixing content occlusion.
MDN Web Docs
Ishadeed
Related work (complementary): interactive-widget viewport keyword (helps with resize policy; does not expose geometry).
Markup from hell - HTMHell
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
github-actions commentedon Sep 5, 2025
This comment was automatically generated based on the information you provided. Please don't edit it.
Below is additional information about the web feature (from the web-features project) which is referenced in your proposal.
If this doesn't accurately correspond to your proposal, please update your initial comment to include
web-features: <feature-id>.To find feature IDs, use the web-features explorer.
Feature Virtual keyboard
navigator.virtualKeyboardAPI inspects and controls on-screen virtual keyboards. You can use it to programmatically hide or show a virtual keyboard or respond to the keyboard disappearing or appearing.foolip commentedon Sep 5, 2025
Thanks you @leeyucha for submitting this proposal! I've gone ahead and updated the description to link to https://web-platform-dx.github.io/web-features-explorer/features/virtual-keyboard/ in the web-features section. This was to help the bot (above) find the right feature and link some additional resources.
birtles commentedon Nov 18, 2025
As a Web developer who has tried using this API, I am concerned that it is not suitable for Interop because:
It requires testing on mobile devices in order to be useful, something which I believe is not currently covered by Interop. For example, in my testing, the Chrome for Android implementation:
Unless implementations can be tested for consistent behavior in these areas, it doesn't seem meaningful to include it in Interop.
The dispatch of geometrychange events is undefined (see Where is the dispatch of geometrychange events defined? w3c/virtual-keyboard#21)
The editors appear unresponsive (e.g. see above issue or the TAG response)
Code comments from last time I tried to use this API in an app
And
yulunwu2 commentedon Nov 21, 2025
https://wpt.fyi/results/virtual-keyboard?label=master&label=experimental&aligned&q=virtual%20keyboard
wpt-interop commentedon Feb 12, 2026
Thank you for proposing VirtualKeyboard API for Interop 2026.
We want to let you know it was not selected to be part of Interop this year.
On behalf of the entire Interop team, thank you for submitting it for consideration. We got many more proposals than we could include in this year's project, necessitating some difficult choices. Please note this should not be taken as a comment on the technology as a whole, or our willingness to consider it for Interop in the future. We appreciate the work you put into your proposal, and would welcome your participation in future rounds of Interop.
Posted on behalf of the Interop team.
mattpilott commentedon Sep 9, 2026
@leeyucha 2027?