#32338: Accessibility issues with Django forms RadioSelect and
CheckboxSelectMultiple
-------------------------------------+-------------------------------------
Reporter: Thibaud Colas | Owner: jcoombes
Type: Bug | Status: assigned
Component: Forms | Version: master
Severity: Normal | Resolution:
Keywords: accessibility, | Triage Stage: Accepted
forms, wcag |
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 1
-------------------------------------+-------------------------------------
Comment (by jcoombes):
21/01/21
Okay, so I can reproduce this bug.
I found the relevant template which fills the content of a relevant widget
at:
django/django/forms/templates/django/forms/widgets/multiple_input.html
[The optional version of this template is at
.../django/forms/input_option.html]
This template is used to render the html form using:
django/django/forms/forms.py
BaseForm.as_p,
BaseForm.as_ul,
BaseForm.as_table.
I got stuck today - as_p, as_ul and as_table call _html_output() with
different parameters.
Changing _html_output() is risky as it would be easy to break single-
choice form fields. The code is already quite abstracted.
Easier approach:
Create and document a new method as_fieldset() for this new use case.
Avoid _html_output() entirely.
Harder approach:
Rewrite _html_output() to include the html tags necessary to render
RadioSelect and CheckboxSelectMultiple accessibly.
Avoid breaking existing code.
I think I will take the easier approach, but I'm open to feedback on how
to do it the harder way without introducing regressions.
--
Ticket URL: <https://code.djangoproject.com/ticket/32338#comment:7>
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 on the web visit
https://groups.google.com/d/msgid/django-updates/070.6b0375acc7f3c78306a0478a22b0012a%40djangoproject.com.