[Django] #34040: Autofocus on model list views can be problematic for screen reader users

2 views
Skip to first unread message

Django

unread,
Sep 24, 2022, 3:43:25 AM9/24/22
to django-...@googlegroups.com
#34040: Autofocus on model list views can be problematic for screen reader users
-------------------------------------+-------------------------------------
Reporter: Thibaud | Owner: nobody
Colas |
Type: Bug | Status: new
Component: | Version: 4.0
contrib.admin | Keywords: accessibility,
Severity: Normal | screen reader, keyboard
Triage Stage: | Has patch: 0
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 1 |
-------------------------------------+-------------------------------------
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 [https://developer.mozilla.org/en-
US/docs/Web/HTML/Global_attributes/autofocus 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.

--
Ticket URL: <https://code.djangoproject.com/ticket/34040>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Sep 24, 2022, 12:10:54 PM9/24/22
to django-...@googlegroups.com
#34040: Autofocus on model list views can be problematic for screen reader users
-------------------------------------+-------------------------------------
Reporter: Thibaud Colas | Owner: nobody
Type: Bug | Status: new
Component: contrib.admin | Version: 4.0
Severity: Normal | Resolution:
Keywords: accessibility, | Triage Stage: Accepted
screen reader, keyboard |
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 1
-------------------------------------+-------------------------------------
Changes (by Jacob Walls):

* stage: Unreviewed => Accepted


Comment:

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.

--
Ticket URL: <https://code.djangoproject.com/ticket/34040#comment:1>

Django

unread,
Sep 25, 2022, 9:39:36 AM9/25/22
to django-...@googlegroups.com
#34040: Autofocus on model list views can be problematic for screen reader users
-------------------------------------+-------------------------------------
Reporter: Thibaud Colas | Owner: moshe
| nahmias
Type: Bug | Status: assigned

Component: contrib.admin | Version: 4.0
Severity: Normal | Resolution:
Keywords: accessibility, | Triage Stage: Accepted
screen reader, keyboard |
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 1
-------------------------------------+-------------------------------------
Changes (by moshe nahmias):

* owner: nobody => moshe nahmias
* status: new => assigned


--
Ticket URL: <https://code.djangoproject.com/ticket/34040#comment:2>

Django

unread,
Sep 26, 2022, 2:18:43 PM9/26/22
to django-...@googlegroups.com
#34040: Autofocus on model list views can be problematic for screen reader users
-------------------------------------+-------------------------------------
Reporter: Thibaud Colas | Owner: moshe
| nahmias
Type: Bug | Status: assigned
Component: contrib.admin | Version: 4.0
Severity: Normal | Resolution:
Keywords: accessibility, | Triage Stage: Ready for
screen reader, keyboard | checkin
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 1
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak):

* has_patch: 0 => 1
* stage: Accepted => Ready for checkin


Comment:

[https://github.com/django/django/pull/16114 PR]

--
Ticket URL: <https://code.djangoproject.com/ticket/34040#comment:3>

Django

unread,
Sep 26, 2022, 3:07:24 PM9/26/22
to django-...@googlegroups.com
#34040: Autofocus on model list views can be problematic for screen reader users
-------------------------------------+-------------------------------------
Reporter: Thibaud Colas | Owner: moshe
| nahmias
Type: Bug | Status: closed
Component: contrib.admin | Version: 4.0
Severity: Normal | Resolution: fixed

Keywords: accessibility, | Triage Stage: Ready for
screen reader, keyboard | checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 1
-------------------------------------+-------------------------------------
Changes (by GitHub <noreply@…>):

* status: assigned => closed
* resolution: => fixed


Comment:

In [changeset:"d938b3b2577807ffd585f654caa0f37d9574e565" d938b3b]:
{{{
#!CommitTicketReference repository=""
revision="d938b3b2577807ffd585f654caa0f37d9574e565"
Fixed #34040 -- Removed autofocus from admin search box.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/34040#comment:4>

Reply all
Reply to author
Forward
0 new messages