-
Notifications
You must be signed in to change notification settings - Fork 19
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
Safari 6 (Mac OS X and iOS) round long values inside input type="number" #71
Comments
Works as expected in Safari 7. |
More useful discussion from @dmethvin here: https://twitter.com/davemethvin/status/751107262471606272 |
So the problem is that Safari 6 stores and displays the floating-point value rather than the string value, even though the unrounded string is a valid floating-point number per the html 5 spec (and thus can be kept as a string and converted to a rounded double-precision float when needed)? Browser bug sounds about right, maybe even browser quirk. |
I believe that the browser should not be doing this per spec; however, note that this kind of use of
https://html.spec.whatwg.org/multipage/forms.html#number-state-(type=number) |
Yeah, the docs seem pretty clear. If you actually want an IEEE floating point value out of the process this bug doesn't make that much difference. Trying to use a |
Good conversation, thanks for chiming in. Really, the root problem is Android won't show the numeric keypad on Android unless it's a type of So to launch the optimal keypad on Android, we've been trying to make the You can get rid of the spinner buttons with this CSS on webkit and FF with a bit of CSS:
And we've added extra JS to ignore the arrow keys and other triggers that would increment/decrement the value. Fun! Let's just say this is a messy situation. But I don't think the other answer (use |
Thanks for the detailed explanation @toddparker! Yeah this seems like the perfect place to apply that |
Just for fun, I wanted to see if the latest Android (6) finally supported inputmode Using |
I'm pretty sure this is expected: double (64-bit float) can't store that much precision, only 52 bits of precision. That's between 15 and 17 decimal digits. |
Worse, this doesn’t seem to be feature testable, given the following: Safari 6 and Firefox 47
Note that Firefox 47 exhibits the same behavior for the above feature test attempt, however operates correctly from a UX perspective: typing |
More test data here:
Using the value Safari 6 setting
|
FWIW per spec valueAsNumber should be converted to a floating point number (so by your account "incorrect") whereas value should just be the typed string. |
@domenic Ah yeah, sorry. Will correct it to say “mismatched” instead of “incorrect” |
.value = "12341234123412341234";
The text was updated successfully, but these errors were encountered: