I am using Cordova 3.5 and jQuery mobile to build an iOS app. I have disabled scrolling in most of the app; however, when I select an input field, the iOS keyboard opens and scr
Add this plugin with
cordova plugin add https://github.com/driftyco/ionic-plugins-keyboard.git
in the command line.
Add the following line anywhere it the javascript to disable scrolling from the keyboard.
cordova.plugins.Keyboard.disableScroll(true);
In my use case, I added a deviceready
event listener to evaluate this line, disabling the automatic keyboard scrolling everywhere in the app.
That's it!
From my experience, and saying this as a developer who avoids 3rd party plugins as much as possible, I've found that virtual keyboard issues in Cordova are best solved with a plugin.
The Cordova plugin directory has several keyboard
plugins
(http://cordova.apache.org/plugins/?q=keyboard)
I recommend the following plugin:
https://github.com/cjpearson/cordova-plugin-keyboard
Which provides the following command to disable scrolling when the virtual keyboard is open.
cordova.plugins.Keyboard.disableScrollingInShrinkView(true);