How to listen for keyboard open/close in Javascript/Sencha?

Groppe picture Groppe · Nov 23, 2011 · Viewed 38k times · Source

I have a HTML5/Javascript (Sencha) app that I have packed into PhoneGap for iOS in XCode. One way or another, I want to be able to listen for the keyboard open/close events and do something accordingly. Is there any way to do this?

Answer

heyjii picture heyjii · Nov 23, 2011

Keyboard will be automatically invoked while you are focusing textfield, textareafield ... . So you can create listener to the focus event in javascript which is similar to listening to the keyboard open event. Also you can use the blur listener to handle the keyboard close.

Thanks.