Skip to content

Files

Latest commit

 

History

History
13 lines (12 loc) · 874 Bytes

112.md

File metadata and controls

13 lines (12 loc) · 874 Bytes
title date submitter number tags discussion
I want virtual keyboard related events
2020-02-19 23:37:47 UTC
Steven Sullivan
112
user-experience
javascript

Right now the best way I know of to listen for the virtual keyboard is to listen to focus/blur or window resize events. This is hacky and unreliable. I would prefer to listen explicitly for onKeyboardUp, onKeyboardDown, and onKeyboardResize, and the event object should include the dimensions of the keyboard.

This limitation causes problems if you are trying to pin an input to the bottom of the screen or if the screen does not support scrolling. The browser will attempt to scroll the input into view and if it can’t, the keyboard will cover the input. Listening for keyboard events would allow for this to be handled more easily.