Old description:
> The following snippet:
>
> {{{
> <select name="permissions_old" id="id_permissions_from" multiple=""
> class="filtered" data-field-name="permissions" data-is-stacked="0">
> }}}
>
> in `admin/auth/group/add/` is lacking the accessible name for the
> selected. We suspect is the JS widget modified the label generated.
>
> The problematic select elements:
>
> -
> https://github.com/django/django/blob/main/django/contrib/admin/static/admin/js/SelectFilter2.js#L16
> -
> https://github.com/django/django/blob/main/django/contrib/admin/static/admin/js/SelectFilter2.js#L113
>
> And where their labels need to be created:
>
> -
> https://github.com/django/django/blob/main/django/contrib/admin/static/admin/js/SelectFilter2.js#L38
> -
> https://github.com/django/django/blob/main/django/contrib/admin/static/admin/js/SelectFilter2.js#L83
New description:
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:
[[Image(https://code.djangoproject.com/raw-attachment/ticket/34625
/permissions-multiple.gif)]]
There are two problems here:
- "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).
- "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.
HTML markup:
{{{
<select name="permissions_old" id="id_permissions_from" multiple=""
class="filtered" data-field-name="permissions" data-is-stacked="0">
}}}
---
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:
-
https://github.com/django/django/blob/main/django/contrib/admin/static/admin/js/SelectFilter2.js#L16
-
https://github.com/django/django/blob/main/django/contrib/admin/static/admin/js/SelectFilter2.js#L113
And where their labels need to be created:
-
https://github.com/django/django/blob/main/django/contrib/admin/static/admin/js/SelectFilter2.js#L38
-
https://github.com/django/django/blob/main/django/contrib/admin/static/admin/js/SelectFilter2.js#L83
--
--
Ticket URL: <https://code.djangoproject.com/ticket/34619#comment:4>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* owner: nobody => Amanda Accalai
* status: new => assigned
--
Ticket URL: <https://code.djangoproject.com/ticket/34619#comment:5>
Comment (by Thibaud Colas):
@Amanda, just a heads’up someone else has been working on this already as
part of the DjangoCon Europe sprint. So it might be better for you to hold
off working on this if they are still busy with it.
--
Ticket URL: <https://code.djangoproject.com/ticket/34619#comment:6>
* owner: Amanda Accalai => (none)
* status: assigned => new
Comment:
thanks for the information. deassign the card
--
Ticket URL: <https://code.djangoproject.com/ticket/34619#comment:7>
* owner: (none) => Robin Zachmann
* status: new => assigned
--
Ticket URL: <https://code.djangoproject.com/ticket/34619#comment:8>