[Django] #33235: MultiWidget id_for_label

24 views
Skip to first unread message

Django

unread,
Oct 28, 2021, 2:34:47 PM10/28/21
to django-...@googlegroups.com
#33235: MultiWidget id_for_label
------------------------------------------------+------------------------
Reporter: Maxim Danilov | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: Forms | Version: 3.2
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 |
------------------------------------------------+------------------------
The instance from Raw MultiWidget class generate id_for_label like
f'{id_}0'
It has not sense.

For example ChoiceWidget has self.add_id_index and I can decide it myself,
how I will see label_id - with or without index.

I think, it is better to remove completely id_for_label method from
MultiWidget Class.

--
Ticket URL: <https://code.djangoproject.com/ticket/33235>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Oct 29, 2021, 1:27:47 AM10/29/21
to django-...@googlegroups.com
#33235: Remove "for = ..." from MultiWidget's <label>.
-------------------------------------+-------------------------------------

Reporter: Maxim Danilov | Owner: nobody
Type: | Status: new
Cleanup/optimization |
Component: Forms | Version: 3.2
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: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak):

* cc: Thibaud Colas, David Smith, Tom Carrick (added)
* keywords: => accessibility, forms, wcag
* stage: Unreviewed => Accepted


Comment:

I agree that we should remove `for` from MultiWidget's `<label>` but not
because ''"It has not sense"'' but to improve accessibility when using a
screen reader, see also #32338. It should be enough to return an empty
string:
{{{#!python
def id_for_label(self, id_):
return ''
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/33235#comment:1>

Django

unread,
Oct 29, 2021, 4:39:51 AM10/29/21
to django-...@googlegroups.com
#33235: Remove "for = ..." from MultiWidget's <label>.
-------------------------------------+-------------------------------------
Reporter: Maxim Danilov | Owner: David
Type: | Smith
Cleanup/optimization | Status: assigned
Component: Forms | Version: 3.2

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: 0
-------------------------------------+-------------------------------------
Changes (by David Smith):

* owner: nobody => David Smith
* status: new => assigned


--
Ticket URL: <https://code.djangoproject.com/ticket/33235#comment:2>

Django

unread,
Nov 4, 2021, 10:38:28 PM11/4/21
to django-...@googlegroups.com
#33235: Remove "for = ..." from MultiWidget's <label>.
-------------------------------------+-------------------------------------
Reporter: Maxim Danilov | Owner: David
Type: | Smith
Cleanup/optimization | Status: assigned
Component: Forms | Version: 3.2

Severity: Normal | Resolution:
Keywords: accessibility, | Triage Stage: Accepted
forms, wcag |
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Jacob Walls):

* has_patch: 0 => 1


Comment:

[https://github.com/django/django/pull/15061 PR]

--
Ticket URL: <https://code.djangoproject.com/ticket/33235#comment:3>

Django

unread,
Nov 5, 2021, 6:06:51 AM11/5/21
to django-...@googlegroups.com
#33235: Remove "for = ..." from MultiWidget's <label>.
-------------------------------------+-------------------------------------
Reporter: Maxim Danilov | Owner: David
Type: | Smith
Cleanup/optimization | Status: assigned
Component: Forms | Version: 3.2
Severity: Normal | Resolution:
Keywords: accessibility, | Triage Stage: Ready for
forms, wcag | checkin
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak):

* stage: Accepted => Ready for checkin


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

Django

unread,
Nov 5, 2021, 6:34:04 AM11/5/21
to django-...@googlegroups.com
#33235: Remove "for = ..." from MultiWidget's <label>.
-------------------------------------+-------------------------------------
Reporter: Maxim Danilov | Owner: David
Type: | Smith
Cleanup/optimization | Status: closed
Component: Forms | Version: 3.2
Severity: Normal | Resolution: fixed

Keywords: accessibility, | Triage Stage: Ready for
forms, wcag | checkin
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak <felisiak.mariusz@…>):

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


Comment:

In [changeset:"c6c6cd3c5ad9c36795bb120e521590424f034ae4" c6c6cd3]:
{{{
#!CommitTicketReference repository=""
revision="c6c6cd3c5ad9c36795bb120e521590424f034ae4"
Fixed #33235 -- Removed "for = ..." from MultiWidget's <label>.

This improves accessibility for screen reader users.
}}}

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

Reply all
Reply to author
Forward
0 new messages