#34622 closed Bug (fixed)

RelatedFieldWidgetWrapper links don’t convey their state for screen reader users

Reported by: Thibaud Colas Owned by: Coen van der Kamp
Component: contrib.admin Version: 4.2
Severity: Normal Keywords: accessibility, screen reader
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: yes

Description

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).

_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).

Change History (6)

comment:1 by Mariusz Felisiak, 17 months ago

Triage Stage: UnreviewedAccepted

comment:3 by Mariusz Felisiak, 17 months ago

Needs tests: set

comment:4 by Coen van der Kamp, 16 months ago

Tests are added.

comment:5 by Mariusz Felisiak, 16 months ago

Needs tests: unset
Triage Stage: AcceptedReady for checkin

comment:6 by Mariusz Felisiak <felisiak.mariusz@…>, 16 months ago

Resolution: fixed
Status: assignedclosed

In 10d9d0cc:

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.

Note: See TracTickets for help on using tickets.
Back to Top