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 , 2 years ago
Triage Stage: | Unreviewed → Accepted |
---|
comment:2 by , 2 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
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 ano-autofocus
rule.