Changes between Version 2 and Version 4 of Ticket #34619


Ignore:
Timestamp:
Jun 9, 2023, 5:42:00 AM (19 months ago)
Author:
Thibaud Colas
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #34619

    • Property Summary Ensures select element has an accessible nameEnsure FilteredSelectMultiple select elements are associated with their label
  • Ticket #34619 – Description

    v2 v4  
    1 The following snippet:
     1In the admin UI, the `FilteredSelectMultiple` is missing labels for some of its elements. Here’s a recording of the widget’s UI, and what users would get for it in VoiceOver:
     2
     3[[Image(https://code.djangoproject.com/raw-attachment/ticket/34625/permissions-multiple.gif)]]
     4
     5There are two problems here:
     6
     7- "Filter edit text" – it’s not ideal for both of those to have the same label. Ideally each side would have a separate label ("Filter Available permissions", "Filter Chosen permissions"). This could be achieved with adding an `aria-describedby` on the filter `input` elements, pointing to the "Available permissions" text (and same for chosen permissions).
     8- "list box" – those `select` elements don’t have a label at all. This needs to be added by transforming the `h2` elements into `label`, with a `for` pointing at each field.
     9
     10HTML markup:
    211
    312{{{
     
    514}}}
    615
    7 in `admin/auth/group/add/` is lacking the accessible name for the selected. We suspect is the JS widget modified the label generated.
     16---
    817
    9 The problematic select elements:
     18This is in `admin/auth/group/add/`. In Django itself, only `contrib.auth` group and user model forms use the `filter_horizontal` ModelAdmin API which has the issue. Not quite sure whether this widget is meant to be reused by users or not. We suspect is the JS widget modified the label generated. The problematic select elements:
    1019
    1120- https://github.com/django/django/blob/main/django/contrib/admin/static/admin/js/SelectFilter2.js#L16
Back to Top