Reputation: 1003
I saw a lot of different threads about this problem, trying to detect if the keyboard is closed on Phonegap.
Wondering if there is any new updates for it for 3.7.0 Phonegap.
I am trying to have a textinput that when focusin, it will move up(Keyboard already does comes up automatically) but when the back button is clicked to close out the keyboard -( The textarea is still focusin), the textarea won't drop back down.
i am trying to find a way to see when the keyboard is closed off.
Like in Google hangout app, when you click the back button it closes the keyboard and the textinput area automatically drops back down to the bottom.
Upvotes: 1
Views: 658
Reputation: 927
You can use the hidekeyboard
and showkeyboard
events to detect keyboard hiding and showing.
document.addEventListener('hidekeyboard', onKeyboardHide, false);
document.addEventListener('showkeyboard', onKeyboardShow, false);
function onKeyboardHide() {
alert("Hide");
}
function onKeyboardShow() {
alert("Show");
}
Upvotes: 1