I have a problem with the KeyboardShrinksView feature that is included in Phonegap 2.6 (ios).
When I tap in the textarea where I want to include text, the keyboard appears and the webview is contracted as I wanted.
The problem is that I lose the focus on the textarea and the user has to tap again in the text area to start writing in it.
Is anyone having the same problem with this new feature?
Thanks!!
add a tap (or touchstart) event on your input which will focus on your field.
element.on("tap", function(e){element.focus()});
The issue comes from the fact that focus is done on ios using the ghost click event. But the view has already changed (because of the keyboard) when it's fired.
This problem will be even more common on ios7 since KeyboardShrinksView is the default behavior...
After the web view is contracted try writing this code.
[TextFieldOnWhichFocusIsExpected BecomeFirstResponder];
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With