Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
In -webkit browsers (the only ones that support number input type at the moment), no matter the base input type, it only allows for integers. This is because the default step value for type=number is 1, when it needs to be set to the precision of the field. See http://code.google.com/p/chromium/issues/detail?id=74120 for details as to what I'm talking about. This really needs to be changed in order to be useful.
Comment | File | Size | Author |
---|---|---|---|
#4 | add_precision_information_as_step.patch | 750 bytes | Berdir |
Comments
Comment #1
ericduran CreditAttribution: ericduran commentedYea, I thought we fix this. A while ago :-/
Comment #2
ericduran CreditAttribution: ericduran commentedHmm, I haven't look into this yet. But I'm pretty sure we pass in the presicion of the field when being used in field ui. Don't we?
Moving this to critical since is the only bug we have open.
Comment #3
Snugug CreditAttribution: Snugug commentedI haven't looked at this in a while, but will double check to make sure that isn't actually what's going on.
Comment #4
BerdirCan confirm that this isn't working.
That's how the field looks for us:
Looking at _numberfield_html5_tools_field_widget_form(), it does use the precision to calculate #size and #maxlength but nothing else.
Attaching a patch that seems to work for me. The value for scale 10 then actually looks like 1.0E-10 but that seems to be accepted by Chrome at least. Stepping down works fine, Stepping up is somehow borked, but that might be Chrome's problem (it works for 2-3 steps but then simply stops, no matter what the value is).
Comment #5
ericduran CreditAttribution: ericduran commentedThanks Everyone.
This is now fixed with proper commit credit.
--
http://drupalcode.org/project/html5_tools.git/commit/39d8e8b