-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
'0.*' not valid number value when trying to add value #1355
Comments
Hmm, it's working fine for me at this playground link... |
Yeah so I have a playground locally and it works ok so I assume it’s to do with the configuration or how I have installed it for my project? |
We are having the same issue as described by @jagribble. @epicfaace If you have a look at this updated playground link, you will be able to reproduce the issue. The only change we've made was to add the "fieldA": {
"ui:options": {
"inputType": "text"
}
}, to the uiSchema. If you then try to input Definitely, either the number field regex or the asNumber method is in problem. Also, as FYI, according to the documentation, it looks like the default html input is Fixing that issue would result in a breaking change so I don't know how it could be tackled in a community perspective. @epicfaace I have time on my plate to fix this issue, let me know if you have any direction to help. We currently have a production issue around that one. |
@abouchard97 found the issue -- see #1360. Meanwhile, for a quick production fix, you could just install from a particular commit:
If you have time, it would be great if you could add a test to finish up the pull request, as well as fix the other test it seems to have broken (although it doesn't seem to have changed functionality?) Additionally, I noticed another bug (which was there before that fix) in that when you type in a number starting with a "." on a text widget for a number type, it shows "0" instead. You could look into that as well; the fix might be in the same file I changed. |
@epicfaace I've made a PR fix the broken test. I tried messing around with the number starting with here (and following lines) : |
Prerequisites
Description
When entering a float number such as `0.1' the number field isn't allowing the insertion of the '.'.
It works as expected with '3.14' for example but whenever the string starts with '0' the user input of '.' is not allowed to be entered.
The schema is confiured as below
NOTE: You are able to enter the number as expected if you put a character infront of the 0 e.g '@0.1' and then deleting the '@'
Steps to Reproduce
Expected behavior
The '.' should be allowed to be entered
Actual behavior
'.' character is not allowed to be entered after a '0'
Version
^1.2.1
I expect it is to do with the
asNumber
function (have commented on the line I think that is stopping it)The text was updated successfully, but these errors were encountered: