You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using Hyperform to validate a simple form including a decimal number field:
<input type="number" step="any">
On both Chrome and Safari (both last public releases), the browser and Hyperform accept both dot and comma as a decimal mark (valid examples: 0.99 and 0,99). But, strangely, on Firefox (57), it rejects the dot as decimal mark (0,99 is valid, but 0.99 is rejected).
I have tried specifying a regexp pattern, an explicit language code accepting both (lang="en-150"), but this behaviour stays the same. I do not understand why Hyperform would act differently on Firefox than on Chrome and Safari. And of course, if there is a workaround to allow both decimal marks to be accepted, that would be great!
The text was updated successfully, but these errors were encountered:
That's indeed a problem with browsers, that do support type="number". Thanks for reporting!
The actual problem is, that the browser's UI is intercepting the user's input before it reaches the DOM. Hyperform never sees, what the user really put into that input. A similar scenario happens with type=email.
I have some preliminary ideas how to tackle that issue, but I need to evaluate them further before I can decide how to fix it. (Example: letting Hyperform changing type to text sounds like a quick fix, but then it has to keep track of what type every input really is, needs to overwrite access to input.type, etc.)
As an interim solution, I had luck with lang="en" (without the -150 specifier), but that might not extend to every combination of browser preferences and lang attributes in the markup.
Thanks a lot for your detailed response. I understand better now. It makes sense indeed the problem is with the browser. What was making me blame Hyperform is that the error message was from Hyperform, not from the browser.
I am using Hyperform to validate a simple form including a decimal number field:
On both Chrome and Safari (both last public releases), the browser and Hyperform accept both dot and comma as a decimal mark (valid examples:
0.99
and0,99
). But, strangely, on Firefox (57), it rejects the dot as decimal mark (0,99
is valid, but0.99
is rejected).I have tried specifying a regexp pattern, an explicit language code accepting both (
lang="en-150"
), but this behaviour stays the same. I do not understand why Hyperform would act differently on Firefox than on Chrome and Safari. And of course, if there is a workaround to allow both decimal marks to be accepted, that would be great!The text was updated successfully, but these errors were encountered: