2

The Issue:

Using

<input id="my_tel" type="tel" onkeypress="alert(event);"/>

<input id="my_num" type="number" onkeypress="alert(event);" />

The issue is that pressing done or enter or go key in android, nothing happens.For all other keys it works fine. When i tried to alert what event is being fired i found none. The keypad does not hide (which is very sad) on pressing go/enter/done button.

However using

input type="text"

the issue does not exist.

Here is what i tried :

A. Used input type="text" and do not allow user to enter anything except numbers.

Problem with this approach : The user is always presented with the default textual keyboard, and she/he has to switch, from default text to number pad, which is not elegant and a turn off as i have many such pages in my project.

B. Used events like 'touchstart'and 'touchend' but no luck.

C. The input box is not even losing focus on key press so the solution html phonegap android : numeric soft keyboard has next instead of go button is not useful.

Possible solution :

We can use the SoftKeyBoard plugin (https://github.com/phonegap/phonegap-plugins/tree/master/Android/SoftKeyboard). And hope that this problem is solved by this. But seriously can't there be a better solution??

Note : The problem is not observed in the iOS app,just android.

Another Note : No DOM event is fired even on pressing backspace key, but atleast the the backspace key is doing its job. In my case the done/go/enter key does not seem to execute its default behavior.

Community
  • 1
  • 1
Danyal
  • 448
  • 4
  • 18

1 Answers1

0

are you using iScroll?, if you are try removing it for a quick test and see what happens. I use it on a phonegap app and it's doing strange things with the inputs.

Felipe Pereira
  • 11,410
  • 4
  • 41
  • 45