Changes between Version 2 and Version 4 of Ticket #34619
- Timestamp:
- Jun 9, 2023, 5:42:00 AM (19 months ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #34619
- Property Summary Ensures select element has an accessible name → Ensure FilteredSelectMultiple select elements are associated with their label
-
Ticket #34619 – Description
v2 v4 1 The following snippet: 1 In 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 5 There 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 10 HTML markup: 2 11 3 12 {{{ … … 5 14 }}} 6 15 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 --- 8 17 9 Th e problematic select elements:18 This 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: 10 19 11 20 - https://github.com/django/django/blob/main/django/contrib/admin/static/admin/js/SelectFilter2.js#L16