#36136: New form field for toggle inputs
-------------------------------------+-------------------------------------
Reporter: Hristo Trendafilov | Owner: (none)
Type: New feature | Status: new
Component: Forms | Version:
Severity: Normal | Resolution:
Keywords: togglefield, | Triage Stage:
toggle, field | Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Description changed by Hristo Trendafilov:
Old description:
> Toggle inputs are quite common web elements and are widely used in modern
> web pages, CSS frameworks, etc.
>
> Those could be narrowed down to the `BooleanField` but with several key
> differences:
>
> - They never be required, even if defied like so;
> - They should always return cleaned data to be `False` if not passed in
> the form data;
> - They should always have an initial value of `False` unless explicitly
> defined;
> - They have a special widget, based on the CheckboxInput, but adding
> `role="switch"` and `aria-checked="false/true"`/based on the value/;
New description:
Toggle inputs are quite common web elements and are widely used in modern
web pages, CSS frameworks, etc.
Those could be narrowed down to the `BooleanField` but with several key
differences:
- They never be required, even if defied like so;
- They should always return cleaned data to be `False` if not passed in
the form data;
- They should always have an initial value of `False` unless explicitly
defined;
- On invalid form data those should not raise ValidationError, but cast
the value to `False`;
- They have a special widget, based on the CheckboxInput, but adding
`role="switch"` and `aria-checked="false/true"`/based on the value/;
--
--
Ticket URL: <https://code.djangoproject.com/ticket/36136#comment:1>
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 [email protected].
To view this discussion visit
https://groups.google.com/d/msgid/django-updates/0107019497a9d4ea-eb7afd94-38f4-4255-ba87-10694098c652-000000%40eu-central-1.amazonses.com.