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

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/010701887bbf25e2-34f05944-f92a-47fd-8944-0c14d77e51dc-000000%40eu-central-1.amazonses.com.

Reply via email to