[Django] #36724: FilteredSelectMultiple widget has broken "for" attribute on <legend>

5 views
Skip to first unread message

Django

unread,
Nov 10, 2025, 4:47:15 PM (2 days ago) Nov 10
to django-...@googlegroups.com
#36724: FilteredSelectMultiple widget has broken "for" attribute on <legend>
-----------------------------+-----------------------------------------
Reporter: Jacob Walls | Type: Bug
Status: new | Component: contrib.admin
Version: 6.0 | Severity: Normal
Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-----------------------------+-----------------------------------------
- View the User model in the admin
- Inspect the label "Groups:"
{{{
<legend for="id_groups">Groups:</legend>
}}}
- Query for that element:
{{{#!js
> document.getElementById("id_groups")
null
}}}

There should probably be an `id` on the empty `<div>` in this structure?

{{{
<div>
<div class="flex-container">
<div class="related-widget-wrapper" data-model-ref="group">
<div class="selector">
<div class="selector-available">
<div id="id_groups_from_title" class="selector-available-title">
...
}}}

SelectFilter2.js constructs ids like "id_groups_from_title" and
"id_groups_selector_chosen" in this case.
--
Ticket URL: <https://code.djangoproject.com/ticket/36724>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Nov 10, 2025, 7:40:09 PM (2 days ago) Nov 10
to django-...@googlegroups.com
#36724: FilteredSelectMultiple widget has broken "for" attribute on <legend>
-------------------------------+------------------------------------
Reporter: Jacob Walls | Owner: (none)
Type: Bug | Status: new
Component: contrib.admin | Version: 6.0
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+------------------------------------
Changes (by Antoliny):

* stage: Unreviewed => Accepted

Comment:

Thank you !

Wouldn't it be better for the legend tag to be associated with the from
box?
--
Ticket URL: <https://code.djangoproject.com/ticket/36724#comment:1>

Django

unread,
Nov 10, 2025, 11:05:10 PM (2 days ago) Nov 10
to django-...@googlegroups.com
#36724: FilteredSelectMultiple widget has broken "for" attribute on <legend>
-------------------------------------+-------------------------------------
Reporter: Jacob Walls | Owner: Varun
| Kasyap Pentamaraju
Type: Bug | Status: assigned
Component: contrib.admin | Version: 6.0
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Varun Kasyap Pentamaraju):

* owner: (none) => Varun Kasyap Pentamaraju
* status: new => assigned

Comment:

Willing to contribute
--
Ticket URL: <https://code.djangoproject.com/ticket/36724#comment:2>

Django

unread,
Nov 11, 2025, 4:41:06 AM (yesterday) Nov 11
to django-...@googlegroups.com
#36724: FilteredSelectMultiple widget has broken "for" attribute on <legend>
-------------------------------------+-------------------------------------
Reporter: Jacob Walls | Owner: Varun
| Kasyap Pentamaraju
Type: Bug | Status: assigned
Component: contrib.admin | Version: 6.0
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Varun Kasyap Pentamaraju):

* has_patch: 0 => 1

Comment:

https://github.com/django/django/pull/20080
--
Ticket URL: <https://code.djangoproject.com/ticket/36724#comment:3>

Django

unread,
Nov 11, 2025, 4:29:33 PM (21 hours ago) Nov 11
to django-...@googlegroups.com
#36724: FilteredSelectMultiple widget has broken "for" attribute on <legend>
-------------------------------------+-------------------------------------
Reporter: Jacob Walls | Owner: Varun
| Kasyap Pentamaraju
Type: Bug | Status: assigned
Component: contrib.admin | Version: 6.0
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 1 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Jacob Walls):

* needs_tests: 0 => 1

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

Django

unread,
9:55 AM (4 hours ago) 9:55 AM
to django-...@googlegroups.com
#36724: FilteredSelectMultiple widget has broken "for" attribute on <legend>
-------------------------------------+-------------------------------------
Reporter: Jacob Walls | Owner: Varun
| Kasyap Pentamaraju
Type: Bug | Status: assigned
Component: contrib.admin | Version: 6.0
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 1 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Description changed by Jacob Walls:

Old description:

> - View the User model in the admin
> - Inspect the label "Groups:"
> {{{
> <legend for="id_groups">Groups:</legend>
> }}}
> - Query for that element:
> {{{#!js
> > document.getElementById("id_groups")
> null
> }}}
>
> There should probably be an `id` on the empty `<div>` in this structure?
>
> {{{
> <div>
> <div class="flex-container">
> <div class="related-widget-wrapper" data-model-ref="group">
> <div class="selector">
> <div class="selector-available">
> <div id="id_groups_from_title" class="selector-available-
> title">
> ...
> }}}
>
> SelectFilter2.js constructs ids like "id_groups_from_title" and
> "id_groups_selector_chosen" in this case.

New description:

- View the User model in the admin
- Inspect the label "Groups:"
{{{
<legend for="id_groups">Groups:</legend>
}}}
- Query for that element:
{{{#!js
> document.getElementById("id_groups")
null
}}}

There should probably be an `id` on the top `<div>` in this structure?

{{{
<div>
<div class="flex-container">
<div class="related-widget-wrapper" data-model-ref="group">
<div class="selector">
<div class="selector-available">
<div id="id_groups_from_title" class="selector-available-title">
...
}}}

SelectFilter2.js constructs ids like "id_groups_from_title" and
"id_groups_selector_chosen" in this case.

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

Django

unread,
10:20 AM (3 hours ago) 10:20 AM
to django-...@googlegroups.com
#36724: FilteredSelectMultiple widget has broken "for" attribute on <legend>
-------------------------------------+-------------------------------------
Reporter: Jacob Walls | Owner: Varun
| Kasyap Pentamaraju
Type: Bug | Status: assigned
Component: contrib.admin | Version: 6.0
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 1 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Jacob Walls):

Actually, the `<legend>` tag doesn't have a `for` attribute.
https://developer.mozilla.org/en-
US/docs/Web/HTML/Reference/Elements/legend
--
Ticket URL: <https://code.djangoproject.com/ticket/36724#comment:6>
Reply all
Reply to author
Forward
0 new messages