-
Notifications
You must be signed in to change notification settings - Fork 531
Fix NaN with value 0 on input type number/range. #430
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
I don't agree with these changes - but am open to being convinced otherwise as I may be missing something here. NaN is the appropriate value to be used when the user enters anything that is "not a number". I also don't agree that numbers stored as strings '0', '1', '2', etc ... should be treated as anything other than strings. The field expects a number, |
2d1cd62 to
31e7ac7
Compare
|
finaly I found the real issue, and change my commit ... |
|
What’s wrong with the NaN result? Is the browser having an issue displaying NaN in the input? |
|
in fact, if you put 0 if the field, you didn't convert the value in number ... ( if (0) => false ) So when value go through https://jsfiddle.net/0mg1v81e/1978/ <= try it , you can't put 0 in field |
|
I can confirm this fixes #425. |
|
Not sure I understand what's being fixed here. Here's the same JSFiddle, pointing to the official 2.1.1 version of VFG ... same result, unless I'm missing something? I'm able to type in -10, -25, 0, etc ... and the form validates them all, what am I missing here? |
|
Without PR : http://recordit.co/bjcamzQq62 |
|
Do you get the same result when using my fiddle against 2.1.1? |
|
I'm sorry but I am not able to find your fiddle... |
|
Doh, I didn't link it ... https://jsfiddle.net/94dcctbf/3/ |
|
Aha! My fiddle uses 2.1.1, not 2.2.1 ... looks like a bug was introduced somewhere in between. I can confirm this is an issue now. |
|
Yeah just spotted that too ! |
|
Could you hotfix/merge this ASAP since it’s a BC minor change and some of us rely on this library in production ? |
Add simple *1 on value for forcing number type.
Number fields delete '0' and '-' on debounce #425
Bug fix
No