SystemicPlural
SystemicPlural

Reputation: 5789

Is it possible to detect when an onscreen keyboard has finished closing with JavaScript

I have a mobile site with inputs for text. After the user finishes entering text, they press a button to proceed. The screen is then redrawn. However the redraw process that happens requires knowledge of the window size before it does its thing (it involves canvas stuff). The problem is that the keyboard has not finished closing when the redraw happens and so the window size is reported incorrectly. Is there anyway to detect when the window has finished closing? Such as an event?

Upvotes: 1

Views: 100

Answers (1)

Andrea Casaccia
Andrea Casaccia

Reputation: 4971

That is an event on the operative system layer, and I guess there is no way of getting it from the browser unless you are developing an hybrid application and you can use some native bridging library like Phonegap/Cordova.

However, I think the answer you are looking for lies in your question: monitoring the height of the window you should be able to understand when a user has opened or closed the onscreen keyboard.

Upvotes: 1

Related Questions