the-darc / angular-virtual-keyboard

An AngularJs Virtual Keyboard Interface based on GreyWyvern VKI
http://the-darc.github.io/angular-virtual-keyboard
MIT License
72 stars 41 forks source link

Minus not being accepted from keyboard when inputting into a number field :-( #33

Closed ryanki1 closed 4 years ago

ryanki1 commented 8 years ago

In vki-core.js, line 764, ie.

} else this.VKI_target.value += text;

input of "-", as text, is not being set to input value. In browser console appears following warning:

The specified value "-" is not a valid number. The value must match to the following regular expression: -?(\d+|\d+.\d+|.\d+)([eE][-+]?\d+)?

As a result this.VKI_target.value remains "" and the minus sign has been rejected by the number type input field. So I am not able for example to input a value of -9500.

This regular expression appears to miss at the start [-+] which allows for explicit positive and negative numbers to be entered. I take it that the regular expression and therefore the source of the problem comes from Google as I am using the Chrome browser version 51.0.2704.103. Do you agree?

The problem only seems to happen when i press the angular virtual keyboard "-" key - it just gets ignored - when i use a real keyboard the minus is accepted in the field.

ryanki1 commented 8 years ago

Is anyone there?

ryanki1 commented 4 years ago

Little interest with this issue.. so closing.