Opened 2 years ago

Closed 2 years ago

#34040 closed Bug (fixed)

Autofocus on model list views can be problematic for screen reader users

Reported by: Thibaud Colas Owned by: moshe nahmias
Component: contrib.admin Version: 4.0
Severity: Normal Keywords: accessibility, screen reader, keyboard
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: yes

Description

On model list views such as /admin/auth/group/, if there is a search field, it’s set to autofocus="true". Moving the keyboard focus like this on page load can be confusing for screen reader users, as they don’t have any context as to where they arrive on the page.

In this specific instance – it’s particularly problematic that they are taken to an element that’s not the first interactive element within the main content. The model’s "Add" button is above the search field, and would be very hard to find for a screen reader user taken straight to the search.

My recommendation would be to remove usage of autofocus for search fields like this.

Change History (4)

comment:1 by Jacob Walls, 2 years ago

Triage Stage: UnreviewedAccepted

Makes sense to me (and as you point out, this is not a page composed of a single action only). An additional data point: the eslint plugin jsx-a11y has a no-autofocus rule.

comment:2 by moshe nahmias, 2 years ago

Owner: changed from nobody to moshe nahmias
Status: newassigned

comment:3 by Mariusz Felisiak, 2 years ago

Has patch: set
Triage Stage: AcceptedReady for checkin

comment:4 by GitHub <noreply@…>, 2 years ago

Resolution: fixed
Status: assignedclosed

In d938b3b:

Fixed #34040 -- Removed autofocus from admin search box.

Note: See TracTickets for help on using tickets.
Back to Top