Opened 3 hours ago

Last modified 3 hours ago

#35940 new Bug

SelectFilter choose/remove buttons missing keyboard-friendly state management

Reported by: Thibaud Colas Owned by:
Component: contrib.admin Version: 5.1
Severity: Normal Keywords: accessibility, aria, button, html, javascript, keyboard, screen reader, semantic, disabled, SelectFilter2
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description (last modified by Thibaud Colas)

The SelectFilter2 JS code in use for user permissions management and other parts of the admin is lacking a "disabled" state for its buttons, for keyboard and screen reader users specifically.

See a demo page with this widget. The problem can be reproduced by tabbing to the buttons. This shouldn’t be possible when they are in their "disabled" state:

https://code.djangoproject.com/raw-attachment/ticket/35940/35940-select-filter.webp

For keyboard users this means two unexpected / unnecessary tab stops when moving through the form. For screen reader users, the buttons will behave as if they were functional even though nothing happens when pressing them.

---

The best solution here will be to use the <button> elements’ disabled attribute instead of the CSS active class. This needs to be done for the four "add/remove" buttons:

  • "Choose" (arrow right)
  • "Remove" (arrow left)
  • "Choose all"
  • "Remove all"

Here is the relevant code: SelectedFilter2.js: SelectedFilter.refresh_icons

Attachments (1)

35940-select-filter.webp (23.8 KB ) - added by Thibaud Colas 3 hours ago.

Download all attachments as: .zip

Change History (2)

by Thibaud Colas, 3 hours ago

Attachment: 35940-select-filter.webp added

comment:1 by Thibaud Colas, 3 hours ago

Description: modified (diff)
Note: See TracTickets for help on using tickets.
Back to Top