#20765: HTML5 number input type not working for DecimalField with big
decimal_places
----------------------------------+------------------------
     Reporter:  aleksey.kladov@…  |      Owner:  nobody
         Type:  Bug               |     Status:  new
    Component:  Forms             |    Version:  1.6-beta-1
     Severity:  Normal            |   Keywords:
 Triage Stage:  Unreviewed        |  Has patch:  0
Easy pickings:  0                 |      UI/UX:  0
----------------------------------+------------------------
 DecimalFiled's widget is a NumberInput with step attribute equal to
 10^-decimal_placecese^.
 
https://github.com/django/django/blob/stable/1.6.x/django/forms/fields.py#L374).

 If decimal_places is too big(the exact value for `big` should be found
 here http://www.w3.org/TR/2012/WD-html5-20121025/common-microsyntaxes.html
 #rules-for-parsing-floating-point-number-values) the step value parses to
 0, which is not valid (http://www.w3.org/TR/2012/WD-html5-20121025/common-
 input-element-attributes.html#attr-input-step). It is not good in itself,
 but it also causes surprising and unwanted behaviour.

 For example in Google Chrome input with type="number" and
 step="0.0000000000000000000000000000001" accepts only integer values!

 A possible  fix is to add optional `step` argument to DecimalField and,
 and if it is not provided just use "any".

-- 
Ticket URL: <https://code.djangoproject.com/ticket/20765>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/067.ea1b1575606673fcc2033a624ab92cb8%40djangoproject.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to