[Django] #36949: Missing label on each <select> in a fieldset

11 views
Skip to first unread message

Django

unread,
Feb 24, 2026, 5:15:27 PMFeb 24
to django-...@googlegroups.com
#36949: Missing label on each <select> in a fieldset
-------------------------------------+-------------------------------------
Reporter: Jacob | Owner: Eliana Rosselli
Walls |
Type: Bug | Status: assigned
Component: Forms | Version: 6.0
Severity: Normal | Keywords: accessibility,
Triage Stage: | fieldset
Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
As Thibaud mentioned
[https://github.com/django/django/pull/15317#discussion_r835962239 here]
when `use_fieldset` was added to forms, we're lacking a label on each
`<select>` element in a `<fieldset>`, even though a `<legend>` is present
for the fieldset.

Now that the admin uses `Widget.use_fieldset` since #35892, it's easy to
reproduce by just checking a `ForeignKey` field in the admin:

Then, in Chrome Dev Tools, the lighthouse tab reports:

> Select elements do not have associated label elements.


Pure forms reproducer, in a shell:

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

class Person(models.Model):
best_friend = models.ForeignKey(
"auth.User",
models.CASCADE,
)
class Meta:
app_label = "myapp.Person"

class MyWidget(forms.Select):
use_fieldset = True

class PersonForm(forms.ModelForm):
class Meta:
model = Person
fields = ["best_friend"]
widgets = {"best_friend": MyWidget}

print(PersonForm().as_p())
}}}
{{{#!py
<p>
<label for="id_best_friend">Best friend:</label>
<select name="best_friend" required id="id_best_friend">
<option value="" selected>---------</option>

<option value="2">anonymous</option>

<option value="1">admin</option>

</select>




</p>
}}}


----
Tentatively assigning to Eli as a Djangonaut Space navigator to evaluate
if a good fit for anyone.
--
Ticket URL: <https://code.djangoproject.com/ticket/36949>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Feb 24, 2026, 5:19:38 PMFeb 24
to django-...@googlegroups.com
#36949: Missing label on each <select> in a fieldset
-------------------------------------+-------------------------------------
Reporter: Jacob Walls | Owner: Eliana
| Rosselli
Type: Bug | Status: assigned
Component: Forms | Version: 6.0
Severity: Normal | Resolution:
Keywords: accessibility, | Triage Stage:
fieldset | Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Jacob Walls):

There's some relevant advice in a related ticket: ticket:36509#comment:1
--
Ticket URL: <https://code.djangoproject.com/ticket/36949#comment:1>

Django

unread,
Mar 2, 2026, 3:49:21 PMMar 2
to django-...@googlegroups.com
#36949: Missing label on each <select> in a fieldset
-------------------------------------+-------------------------------------
Reporter: Jacob Walls | Owner: Eliana
| Rosselli
Type: Bug | Status: assigned
Component: Forms | Version: 6.0
Severity: Normal | Resolution:
Keywords: accessibility, | Triage Stage: Accepted
fieldset |
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Natalia Bidart):

* cc: Eliana Rosselli (added)
* stage: Unreviewed => Accepted

Comment:

Thank you!
--
Ticket URL: <https://code.djangoproject.com/ticket/36949#comment:2>

Django

unread,
Mar 17, 2026, 1:54:49 PMMar 17
to django-...@googlegroups.com
#36949: Missing label on each <select> in a fieldset
-------------------------------------+-------------------------------------
Reporter: Jacob Walls | Owner: Eliana
| Rosselli
Type: Bug | Status: assigned
Component: Forms | Version: 6.0
Severity: Normal | Resolution:
Keywords: accessibility, | Triage Stage: Accepted
fieldset |
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by bhuvnesh):

Submitted PR for review.

PR: https://github.com/django/django/pull/20933
--
Ticket URL: <https://code.djangoproject.com/ticket/36949#comment:3>

Django

unread,
Mar 17, 2026, 2:24:21 PMMar 17
to django-...@googlegroups.com
#36949: Missing label on each <select> in a fieldset
-------------------------------------+-------------------------------------
Reporter: Jacob Walls | Owner: bhuvnesh-
| nama
Type: Bug | Status: assigned
Component: Forms | Version: 6.0
Severity: Normal | Resolution:
Keywords: accessibility, | Triage Stage: Accepted
fieldset |
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Jacob Walls):

* cc: Eliana Rosselli (removed)
* has_patch: 0 => 1
* owner: Eliana Rosselli => bhuvnesh-nama

--
Ticket URL: <https://code.djangoproject.com/ticket/36949#comment:4>

Django

unread,
Mar 17, 2026, 3:18:33 PMMar 17
to django-...@googlegroups.com
#36949: Missing label on each <select> in a fieldset
-------------------------------------+-------------------------------------
Reporter: Jacob Walls | Owner: bhuvnesh-
| nama
Type: Bug | Status: assigned
Component: Forms | Version: 6.0
Severity: Normal | Resolution:
Keywords: accessibility, | Triage Stage: Accepted
fieldset |
Has patch: 1 | Needs documentation: 0
Needs tests: 1 | Patch needs improvement: 1
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Jacob Walls):

* cc: David Smith (added)
* needs_better_patch: 0 => 1
* needs_tests: 0 => 1

--
Ticket URL: <https://code.djangoproject.com/ticket/36949#comment:5>

Django

unread,
Mar 18, 2026, 3:52:09 AMMar 18
to django-...@googlegroups.com
#36949: Missing label on each <select> in a fieldset
-------------------------------------+-------------------------------------
Reporter: Jacob Walls | Owner: bhuvnesh-
| nama
Type: Bug | Status: assigned
Component: Forms | Version: 6.0
Severity: Normal | Resolution:
Keywords: accessibility, | Triage Stage: Accepted
fieldset |
Has patch: 1 | Needs documentation: 0
Needs tests: 1 | Patch needs improvement: 1
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by bhuvnesh):

I've pushed updates to the pull request to address the review feedback,
including adding tests and updating the implementation.

PR: https://github.com/django/django/pull/20933
--
Ticket URL: <https://code.djangoproject.com/ticket/36949#comment:6>

Django

unread,
Mar 19, 2026, 9:33:55 AMMar 19
to django-...@googlegroups.com
#36949: Missing label on each <select> in a fieldset
-------------------------------------+-------------------------------------
Reporter: Jacob Walls | Owner: bhuvnesh-
| nama
Type: Bug | Status: assigned
Component: Forms | Version: 6.0
Severity: Normal | Resolution:
Keywords: accessibility, | Triage Stage: Accepted
fieldset |
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Jacob Walls):

* needs_tests: 1 => 0

--
Ticket URL: <https://code.djangoproject.com/ticket/36949#comment:7>

Django

unread,
Mar 23, 2026, 2:58:44 PMMar 23
to django-...@googlegroups.com
#36949: Missing label on each <select> in a fieldset
-------------------------------------+-------------------------------------
Reporter: Jacob Walls | Owner: bhuvnesh-
| nama
Type: Bug | Status: assigned
Component: contrib.admin | Version: 6.0
Severity: Release blocker | Resolution:
Keywords: accessibility, | Triage Stage: Accepted
fieldset |
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Jacob Walls):

* component: Forms => contrib.admin
* severity: Normal => Release blocker

Comment:

David's helpful review revealed that it was a bug in
4187da258fe212d494cb578a0bc2b52c4979ab95 that `self.use_fieldset = True`
was done naively on `RelatedFieldWidgetWrapper` in the admin, so elevating
to release blocker and reclassifying to the admin.
--
Ticket URL: <https://code.djangoproject.com/ticket/36949#comment:8>

Django

unread,
Mar 30, 2026, 9:49:36 AMMar 30
to django-...@googlegroups.com
#36949: Missing label on each <select> in a fieldset
-------------------------------------+-------------------------------------
Reporter: Jacob Walls | Owner: David
| Smith
Type: Bug | Status: assigned
Component: contrib.admin | Version: 6.0
Severity: Release blocker | Resolution:
Keywords: accessibility, | Triage Stage: Accepted
fieldset |
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Jacob Walls):

* owner: bhuvnesh-nama => David Smith

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

Django

unread,
Apr 2, 2026, 10:30:42 AMApr 2
to django-...@googlegroups.com
#36949: Missing label on each <select> in a fieldset
-------------------------------------+-------------------------------------
Reporter: Jacob Walls | Owner: David
| Smith
Type: Bug | Status: assigned
Component: contrib.admin | Version: 6.0
Severity: Release blocker | Resolution:
Keywords: accessibility, | Triage Stage: Ready for
fieldset | checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Jacob Walls):

* cc: Thibaud Colas (removed)
* needs_better_patch: 1 => 0
* stage: Accepted => Ready for checkin

--
Ticket URL: <https://code.djangoproject.com/ticket/36949#comment:10>

Django

unread,
Apr 2, 2026, 11:09:48 AMApr 2
to django-...@googlegroups.com
#36949: Missing label on each <select> in a fieldset
-------------------------------------+-------------------------------------
Reporter: Jacob Walls | Owner: David
| Smith
Type: Bug | Status: closed
Component: contrib.admin | Version: 6.0
Severity: Release blocker | Resolution: fixed
Keywords: accessibility, | Triage Stage: Ready for
fieldset | checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Jacob Walls <jacobtylerwalls@…>):

* resolution: => fixed
* status: assigned => closed

Comment:

In [changeset:"253f552c5809fa096116b601bd842ca4f3504860" 253f552c]:
{{{#!CommitTicketReference repository=""
revision="253f552c5809fa096116b601bd842ca4f3504860"
Fixed #36949 -- Improved RelatedFieldWidgetWrapper <label>s.

Regression in 4187da258fe212d494cb578a0bc2b52c4979ab95.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/36949#comment:11>

Django

unread,
Apr 2, 2026, 11:10:38 AMApr 2
to django-...@googlegroups.com
#36949: Missing label on each <select> in a fieldset
-------------------------------------+-------------------------------------
Reporter: Jacob Walls | Owner: David
| Smith
Type: Bug | Status: closed
Component: contrib.admin | Version: 6.0
Severity: Release blocker | Resolution: fixed
Keywords: accessibility, | Triage Stage: Ready for
fieldset | checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Jacob Walls <jacobtylerwalls@…>):

In [changeset:"ea8e293fda0dd1e78f5489efa73e5d19e195b4f0" ea8e293f]:
{{{#!CommitTicketReference repository=""
revision="ea8e293fda0dd1e78f5489efa73e5d19e195b4f0"
[6.0.x] Fixed #36949 -- Improved RelatedFieldWidgetWrapper <label>s.

Regression in 4187da258fe212d494cb578a0bc2b52c4979ab95.

Backport of 253f552c5809fa096116b601bd842ca4f3504860 from main.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/36949#comment:12>

Django

unread,
Apr 3, 2026, 9:30:21 AMApr 3
to django-...@googlegroups.com
#36949: Missing label on each <select> in a fieldset
-------------------------------------+-------------------------------------
Reporter: Jacob Walls | Owner: David
| Smith
Type: Bug | Status: closed
Component: contrib.admin | Version: 6.0
Severity: Release blocker | Resolution: fixed
Keywords: accessibility, | Triage Stage: Ready for
fieldset | checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Jacob Walls <jacobtylerwalls@…>):

In [changeset:"123fa3a3f38abdb73055acc9a2cbbe3537f9323a" 123fa3a3]:
{{{#!CommitTicketReference repository=""
revision="123fa3a3f38abdb73055acc9a2cbbe3537f9323a"
Refs #36949 -- Removed hardcoded pks in modeladmin tests.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/36949#comment:13>

Django

unread,
Apr 3, 2026, 3:30:26 PMApr 3
to django-...@googlegroups.com
#36949: Missing label on each <select> in a fieldset
-------------------------------------+-------------------------------------
Reporter: Jacob Walls | Owner: David
| Smith
Type: Bug | Status: closed
Component: contrib.admin | Version: 6.0
Severity: Release blocker | Resolution: fixed
Keywords: accessibility, | Triage Stage: Ready for
fieldset | checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Jacob Walls <jacobtylerwalls@…>):

In [changeset:"ffc83c554a7bc99e138445fa2c4beaf0ca17c71c" ffc83c55]:
{{{#!CommitTicketReference repository=""
revision="ffc83c554a7bc99e138445fa2c4beaf0ca17c71c"
[6.0.x] Refs #36949 -- Removed hardcoded pks in modeladmin tests.

Backport of 123fa3a3f38abdb73055acc9a2cbbe3537f9323a from main.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/36949#comment:14>
Reply all
Reply to author
Forward
0 new messages