Re: [Django] #36828: Missing input labels (WCAG2.1)

5 views
Skip to first unread message

Django

unread,
Dec 26, 2025, 7:32:46 PM (3 days ago) Dec 26
to django-...@googlegroups.com
#36828: Missing input labels (WCAG2.1)
-------------------------------------+-------------------------------------
Reporter: Johannes Maron | Owner:
| Youngkwang Yang
Type: Bug | Status: assigned
Component: Forms | Version: dev
Severity: Normal | Resolution:
Keywords: accessibility | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Antoliny):

Thank you, Joe :)

Could you share an example of where the issue shows up?

My guess is that you’re referring to ClearableFileInput, which was
recently switched to use a fieldset. When using the ClearableFileInput
widget and an initial value is present, it appears that the input for
changing the value does not have an associated label.

From what I can tell, this issue seems to have existed even before the
switch to fieldset, and may not be directly caused by that change.

**5.0**

[[Image(missing_label.png)]]

Is this the case you had in mind?
--
Ticket URL: <https://code.djangoproject.com/ticket/36828#comment:8>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Dec 26, 2025, 7:33:03 PM (3 days ago) Dec 26
to django-...@googlegroups.com
#36828: Missing input labels (WCAG2.1)
-------------------------------------+-------------------------------------
Reporter: Johannes Maron | Owner:
| Youngkwang Yang
Type: Bug | Status: assigned
Component: Forms | Version: dev
Severity: Normal | Resolution:
Keywords: accessibility | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Antoliny):

* Attachment "missing_label.png" added.

--
Ticket URL: <https://code.djangoproject.com/ticket/36828>

Django

unread,
Dec 26, 2025, 7:47:01 PM (3 days ago) Dec 26
to django-...@googlegroups.com
#36828: Missing input labels (WCAG2.1)
-------------------------------------+-------------------------------------
Reporter: Johannes Maron | Owner:
| Youngkwang Yang
Type: Bug | Status: assigned
Component: Forms | Version: dev
Severity: Normal | Resolution:
Keywords: accessibility | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Antoliny):

* cc: Antoliny (added)

--
Ticket URL: <https://code.djangoproject.com/ticket/36828#comment:9>

Django

unread,
Dec 26, 2025, 10:32:57 PM (3 days ago) Dec 26
to django-...@googlegroups.com
#36828: Missing input labels (WCAG2.1)
-------------------------------------+-------------------------------------
Reporter: Johannes Maron | Owner:
| Youngkwang Yang
Type: Bug | Status: assigned
Component: Forms | Version: dev
Severity: Normal | Resolution:
Keywords: accessibility | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Antoliny):

* Attachment "missing_label.png" removed.

Django

unread,
12:09 PM (2 hours ago) 12:09 PM
to django-...@googlegroups.com
#36828: Missing input labels (WCAG2.1)
-------------------------------------+-------------------------------------
Reporter: Johannes Maron | Owner:
| Youngkwang Yang
Type: Bug | Status: assigned
Component: Forms | Version: 6.0
Severity: Release blocker | Resolution:
Keywords: accessibility, | Triage Stage: Accepted
label, wcag, fieldset |
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Jacob Walls):

* keywords: accessibility => accessibility, label, wcag, fieldset
* severity: Normal => Release blocker
* stage: Unreviewed => Accepted
* version: dev => 6.0

Comment:

Accepting as a 6.0 regression on the basis that when `use_fieldset = True`
was used on `ClearableFileInput` in #35892, we didn't audit its template
for the presence of a `<label>`. `radio_option.html` had a label, but
`clearable_file_input.html` didn't.

> Since the original label was replaced by a legend, it seems that this
part (the “changed” input) should now have an associated label.

I agree -- thanks for the triage!!

> When using the ClearableFileInput widget and an initial value is
present, it appears that the input for changing the value does not have an
associated label.

I don't think it depends on the initial value, see:

{{{#!py
from django.db import models
from django import forms

class Upload(models.Model):
file = models.FileField(
verbose_name="CSV-File",
upload_to="csv",
help_text="File containing comma separated values.",
)
class Meta:
app_label = "myapp.Upload"

class UploadForm(forms.ModelForm):
class Meta:
model = Upload
fields = ["file"]

print(UploadForm().as_div())
}}}

5.2.9, with `<label>`:
{{{#!py
<div>
<label for="id_file">CSV-File:</label>

<div class="helptext" id="id_file_helptext">File containing comma
separated values.</div>

<input type="file" name="file" required aria-
describedby="id_file_helptext" id="id_file">



</div>
}}}
6.0, without:
{{{#!py
<div>
<fieldset aria-describedby="id_file_helptext">
<legend for="id_file">CSV-File:</legend>

<div class="helptext" id="id_file_helptext">File containing comma
separated values.</div>

<input type="file" name="file" required id="id_file"></fieldset>



</div>
}}}

We should target a fix for 6.0.1 on January 6.
--
Ticket URL: <https://code.djangoproject.com/ticket/36828#comment:10>
Reply all
Reply to author
Forward
0 new messages