Chrome/Edge browser virtual keyboard will usher in a major update

Microsoft and Google are developing a new API called Virtual Keyboard for Chromium-based browsers (such as Chrome browser and Edge browser). This API can update the existing on-screen keyboards used for input on Windows, macOS, Chrome OS, and Android phones and provide better control.

As pointed out in a document, the virtual keyboard (VK) is a public JS API that hands control of the on-screen keyboard to web developers. Currently, developers cannot show/hide to improve/cancel the virtual keyboard, and the performance of the keyboard is not ideal for scenarios where developers want users to use the website’s built-in/rendered keyboard to enter passwords on Android.

In addition, in some cases, developers only want the cursor to be displayed in an editable element until the user clicks again to display the virtual keyboard. This is possible in the case of inputMode=none, but input mode confuses the two The different concepts (layout and visibility of VK) should be separated to meet more complex situations, the document reads.

Microsoft and Google are working on a new feature that will deal with hiding/showing the keyboard and controlling whether the visual viewport is resized when the virtual keyboard changes its visibility. In theory, VirtualKeyboard APIs will be updated for developers to have more control over when the virtual keyboard is shown or hidden.

It also maps events, describes the intersection of the VK and the layout viewport and can choose to not adjust the size of its visual viewport in response to changes in VK visibility, Microsoft said.

Unlike web browsers or web applications, native Android or Windows applications have the ability to monitor operating system events. Using this new API, developers bring an enhanced experience to the web on desktop and mobile. Therefore, the editable area on the website will always remain visible.

Developers can choose to add a new style, the docked virtual keyboard will cover the content, and developers will be able to optimize the layout viewport for the virtual keyboard. For example, when the virtual keyboard appears on your phone, the browser will not scroll editable elements into view, nor will it adjust the size of the visual/layout viewport to match the size of the new window when the overlay content flag is set.

The company said: This is because we want web developers to be able to control the layout of the content after VK shows/hides. Microsoft has confirmed that the upgraded API will support browsers on touch platforms with virtual keyboards. This includes Windows, Chrome OS, and Android. But it will not work on Mac, Linux or Android WebView.

According to Google’s status page, the Chrome browser will get support for the virtual keyboard API in the desktop and mobile version 94. In addition, the Chrome browser will also get its own screenshot tool and other improvements in the next update.

Leave a Comment