[Django] #34622: RelatedFieldWidgetWrapper links don’t convey their state for screen reader users

12 views
Skip to first unread message

Django

unread,
Jun 2, 2023, 6:55:08 AM6/2/23
to django-...@googlegroups.com
#34622: RelatedFieldWidgetWrapper links don’t convey their state for screen reader
users
-------------------------------------+-------------------------------------
Reporter: Thibaud | Owner: Coen van der Kamp
Colas |
Type: Bug | Status: assigned
Component: | Version: 4.2
contrib.admin | Keywords: accessibility,
Severity: Normal | screen reader
Triage Stage: | Has patch: 0
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 1 |
-------------------------------------+-------------------------------------
Fields using `RelatedFieldWidgetWrapper` have three links/buttons next to
them to go to the Change/Add/View views for their model. Those links use a
bit of JS to toggle whether the link is active or not based on whether the
field has a value.

This link state (disabled/enabled) isn’t communicated to screen reader
users in any way. We should be able to solve this by adding a `aria-
disabled="true"` attribute on those links when they are disabled (making
sure to remove the attribute when the links are enabled).

- Template:
https://github.com/django/django/blob/main/django/contrib/admin/templates/admin/widgets/related_widget_wrapper.html
- And I believe the "link enabled/disabled" logic happens here:
https://github.com/django/django/blob/main/django/contrib/admin/static/admin/js/admin/RelatedObjectLookups.js


_In addition_ this is unrelated but it’d be much nicer for screen reader
users if the images within those links had `alt=""`. Right now the
presence of `alt` means screen reader users will hear "link, image,
Change" – the fact there’s an image is completely irrelevant here. It’d be
much better to instead have `link, Change selected <thing>` (coming from
the title attribute).

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

Django

unread,
Jun 2, 2023, 7:06:10 AM6/2/23
to django-...@googlegroups.com
#34622: RelatedFieldWidgetWrapper links don’t convey their state for screen reader
users
-------------------------------------+-------------------------------------
Reporter: Thibaud Colas | Owner: Coen van
| der Kamp
Type: Bug | Status: assigned
Component: contrib.admin | Version: 4.2
Severity: Normal | Resolution:
Keywords: accessibility, | Triage Stage: Accepted
screen reader |
Has patch: 0 | Needs documentation: 0

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

* stage: Unreviewed => Accepted


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

Django

unread,
Jun 2, 2023, 7:30:47 AM6/2/23
to django-...@googlegroups.com
#34622: RelatedFieldWidgetWrapper links don’t convey their state for screen reader
users
-------------------------------------+-------------------------------------
Reporter: Thibaud Colas | Owner: Coen van
| der Kamp
Type: Bug | Status: assigned
Component: contrib.admin | Version: 4.2
Severity: Normal | Resolution:
Keywords: accessibility, | Triage Stage: Accepted
screen reader |
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 1
-------------------------------------+-------------------------------------
Changes (by Coen van der Kamp):

* has_patch: 0 => 1


Comment:

PR: https://github.com/django/django/pull/16927

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

Django

unread,
Jun 2, 2023, 7:36:59 AM6/2/23
to django-...@googlegroups.com
#34622: RelatedFieldWidgetWrapper links don’t convey their state for screen reader
users
-------------------------------------+-------------------------------------
Reporter: Thibaud Colas | Owner: Coen van
| der Kamp
Type: Bug | Status: assigned
Component: contrib.admin | Version: 4.2
Severity: Normal | Resolution:
Keywords: accessibility, | Triage Stage: Accepted
screen reader |
Has patch: 1 | Needs documentation: 0
Needs tests: 1 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 1
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak):

* needs_tests: 0 => 1


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

Django

unread,
Jun 4, 2023, 9:46:50 AM6/4/23
to django-...@googlegroups.com
#34622: RelatedFieldWidgetWrapper links don’t convey their state for screen reader
users
-------------------------------------+-------------------------------------
Reporter: Thibaud Colas | Owner: Coen van
| der Kamp
Type: Bug | Status: assigned
Component: contrib.admin | Version: 4.2
Severity: Normal | Resolution:
Keywords: accessibility, | Triage Stage: Accepted
screen reader |
Has patch: 1 | Needs documentation: 0
Needs tests: 1 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 1
-------------------------------------+-------------------------------------

Comment (by Coen van der Kamp):

Tests are added.

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

Django

unread,
Jun 5, 2023, 12:04:08 PM6/5/23
to django-...@googlegroups.com
#34622: RelatedFieldWidgetWrapper links don’t convey their state for screen reader
users
-------------------------------------+-------------------------------------
Reporter: Thibaud Colas | Owner: Coen van
| der Kamp
Type: Bug | Status: assigned
Component: contrib.admin | Version: 4.2
Severity: Normal | Resolution:
Keywords: accessibility, | Triage Stage: Ready for
screen reader | checkin

Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 1
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak):

* needs_tests: 1 => 0
* stage: Accepted => Ready for checkin


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

Django

unread,
Jun 5, 2023, 12:05:51 PM6/5/23
to django-...@googlegroups.com
#34622: RelatedFieldWidgetWrapper links don’t convey their state for screen reader
users
-------------------------------------+-------------------------------------
Reporter: Thibaud Colas | Owner: Coen van
| der Kamp
Type: Bug | Status: closed
Component: contrib.admin | Version: 4.2
Severity: Normal | Resolution: fixed

Keywords: accessibility, | Triage Stage: Ready for
screen reader | checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 1
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak <felisiak.mariusz@…>):

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


Comment:

In [changeset:"10d9d0ccb24ebefbcc12f8bc1b90becec64340ee" 10d9d0cc]:
{{{
#!CommitTicketReference repository=""
revision="10d9d0ccb24ebefbcc12f8bc1b90becec64340ee"
Fixed #34622 -- Improved accessibility of related widget wrapper in admin.

This improves accessibility for screen reader users by adding
"aria-disabled" and removing "alt".

Thanks Thibaud Colas for the report.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/34622#comment:6>

Reply all
Reply to author
Forward
0 new messages