Pop Up Keyboard Form Issues

I have noticed an unusual problem that occurs when a changeform occurs while the pop up keyboard is still up.

So for example, a form has a textbox to enter data. User types in the data. The form has an OK button which changes to another form. The problem is that if the keyboard is left up, and someone hits the OK biutton, some of the other forms in the app have a white area at the bottom of the page (all forms are set to screenmode=Full Screen.

It looks like the forms are getting confused perhaps on the screen size with the keyboard up. If I close the keyboard before I change forms, it always works fine.

I saw some earlier threads on how to use blur() to hide keyboard. I implemented this to trap the GO key on the keyboard when a text box has data entered so it closes the keyboard down. Problem is that if the user just types in the textbox and doesn’t hit GO on the keyboard, they can still hit the OK button on the form to changeform.

I trued to call the blur() when the OK button is pressed but it only seems to work on the on “onkeypress” event.

Also tried the cordova-plugin-keyboard but no luck so far

Generally, the problem isn’t with the keyboard or the OK button… the problem is wrapping your input field in a form tag. The form tags are handy on websites but on mobile apps where we tend to use inputs like widgets and we want the OK button to navigate to the next input, instead the OK button triggers the form submit and that leads to all kinds of problems. My suggestion is replace the form tag with a div wrapper and try that.

I hated to fix it this way, but it worked.

Before calling changeform, I called the cordova keyboard.hide, but then did a Sleep 500’’

The sleep gives 500ms for the keyboard to drop before changing forms.

Without the delay it does not work, but this does the trick, a little ugly but gets the job done