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.
* stage: Unreviewed => Accepted
--
Ticket URL: <https://code.djangoproject.com/ticket/34622#comment:1>
* has_patch: 0 => 1
Comment:
PR: https://github.com/django/django/pull/16927
--
Ticket URL: <https://code.djangoproject.com/ticket/34622#comment:2>
* needs_tests: 0 => 1
--
Ticket URL: <https://code.djangoproject.com/ticket/34622#comment:3>
Comment (by Coen van der Kamp):
Tests are added.
--
Ticket URL: <https://code.djangoproject.com/ticket/34622#comment:4>
* needs_tests: 1 => 0
* stage: Accepted => Ready for checkin
--
Ticket URL: <https://code.djangoproject.com/ticket/34622#comment:5>
* 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>