Resolving the virtual keyboard popup issue in Android 2.x browsers

April 12, 2013 in Dojo, JavaScript, mobile

One of the alarming issues of the Android 2.x browsers is that virtual keyboard sometimes becomes open even if the cursor is not focused on an editable field.
This symptom can be extended to a degree that the virtual keyboard can be still open in views other than the one that initially shows the keyboard.

After spending hours in trying to figure out a solution to this problem, I tried the following solutions and none of them worked with me:
1. Disabling the input elements in the form temperaroly.
2. Setting the input elements in the form to read-only temporarily.
3. Blurring the current focused editable field does not also work.

The only way that works with me is to send an enter key to one of the text fields in the form (or to any hidden field) after 1000 milliseconds before performing the transition to any other views, this can be done in Dojo mobile as follows:

window.setTimeout(function() {

    registry.byId("[your dojo/mobile/textbox id]")._onInput({ charOrCode: keys.ENTER });

}, 1000);

If you have a better solution for this issue, let me know.

Leave a reply

Your email address will not be published. Required fields are marked *

291,500 Spam Comments Blocked so far by Spam Free Wordpress

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Powered by sweet Captcha