#32559: Add attribute 'step' to FloatField.
-------------------------------------+-------------------------------------
     Reporter:  Jacob Rief           |                    Owner:  Kapil
                                     |  Bansal
         Type:  New feature          |                   Status:  assigned
    Component:  Forms                |                  Version:  dev
     Severity:  Normal               |               Resolution:
     Keywords:  FloatField,          |             Triage Stage:  Accepted
  NumberInput, step                  |
    Has patch:  1                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
Description changed by Mariusz Felisiak:

Old description:

> If someone wants to use the `step` attribute as provided by the HTML
> field
> `<input type="number" ...>` , she/he has to specify that using for
> instance
> `FloatField(widget=NumberInput(attrs={'step': 0.5}))`.
>
> Since the HTML standard offers a `step` attribute on input fields of
> `type="number"`,
> this feature shall be reflected by Django's `FloatField` and  optionally
> `DecimalField`,
> rather than having to parametrize the widget.
>
> Min- and max-values are already supported by the `FloatField`, so the
> step-value
> would make sense here as well. It furthermore would require to revalidate
> the
> step-value by Django's Form validation, rather than by HTML alone.
>
> Patch: https://github.com/django/django/pull/14162

New description:

 If someone wants to use the `step` attribute as provided by the HTML field
 `<input type="number" ...>` , she/he has to specify that using for
 instance
 `FloatField(widget=NumberInput(attrs={'step': 0.5}))`.

 Since the HTML standard offers a `step` attribute on input fields of
 `type="number"`,
 this feature shall be reflected by Django's `FloatField` and  optionally
 `DecimalField`,
 rather than having to parametrize the widget.

 Min- and max-values are already supported by the `FloatField`, so the
 step-value
 would make sense here as well. It furthermore would require to revalidate
 the
 step-value by Django's Form validation, rather than by HTML alone.

--

-- 
Ticket URL: <https://code.djangoproject.com/ticket/32559#comment:6>
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/063.2247af197449260b557a5f7f4a6df397%40djangoproject.com.

Reply via email to