Opened 4 weeks ago
Closed 11 days ago
#36976 closed Cleanup/optimization (fixed)
Make action selection counter on admin list pages announce changes
| Reported by: | David Ansa | Owned by: | David Ansa |
|---|---|---|---|
| Component: | contrib.admin | Version: | 6.0 |
| Severity: | Normal | Keywords: | accessibility |
| Cc: | aamir_official, Elias Stinson | Triage Stage: | Ready for checkin |
| Has patch: | yes | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | yes | UI/UX: | no |
Description
The admin changelist action counter updates dynamically when selecting or deselecting rows, but the updates are not explicitly announced as live content for assistive technologies.
This can make it harder for screen reader users to perceive selection count changes while performing bulk actions.
Proposed fix
Mark the counter as a polite live region and atomic:
aria-live="polite"
aria-atomic="true"
Patch summary
Updated django/contrib/admin/templates/admin/actions.html:
Added aria-live and aria-atomic attributes to .action-counter.
Added regression test in tests/admin_views/tests.py:
test_actions_counter_is_live_region
Why this is safe
Markup-only accessibility enhancement.
No behavior or JavaScript logic changes.
Existing UI behavior remains unchanged.
Change History (8)
comment:1 by , 4 weeks ago
| Cc: | added |
|---|---|
| Owner: | set to |
| Status: | new → assigned |
comment:3 by , 4 weeks ago
| Cc: | added |
|---|---|
| Component: | Uncategorized → contrib.admin |
| Triage Stage: | Unreviewed → Accepted |
| Type: | Uncategorized → Cleanup/optimization |
I'll second this, and I will change the triage status to accepted, as this seems like a needed and easy improvement to the overall accessibility of Django-based projects. I will also mark it as being a contrib.admin issue, as that's the subject at hand. I also feel that cleanup/optimization is the only real fitting thing, as this isn't a completely new feature, but also isn't a bug. Anyways, good luck to all, and I will CC myself so I can keep track and help if needed!
comment:4 by , 4 weeks ago
| Easy pickings: | set |
|---|---|
| Has patch: | set |
| Keywords: | accessibility added |
| Owner: | changed from to |
| Summary: | Admin: make action selection counter a live region → Make action selection counter on admin list pages announce changes |
| Triage Stage: | Accepted → Ready for checkin |
comment:5 by , 2 weeks ago
Should we expand the scope of this issue to every instance where we use element.textContent = in JavaScript? I spotted 3 other files besides actions.js. They were SelectFilter2, DateTimeShortcuts, calendar and RelatedObjectLookups. These would be similar places where we would need aria-live applied.
comment:6 by , 2 weeks ago
| Patch needs improvement: | set |
|---|---|
| Triage Stage: | Ready for checkin → Accepted |
Smart idea, let's audit those too, but let's check each one. The DateTimeShortcuts example shouldn't be a live region, since it just updates once on page load.
comment:7 by , 11 days ago
| Patch needs improvement: | unset |
|---|---|
| Triage Stage: | Accepted → Ready for checkin |
Hi, I'd like to work on this ticket. I'll submit a PR adding aria-live="polite" and aria-atomic="true" to the action-counter element in actions.html, along with a regression test.