Fixes #22527: Notify screen reader of quick search updates (#22534)

This commit is contained in:
Jeremy Stretch 2026-06-25 07:35:33 -04:00 committed by GitHub
parent 7b1e1a1dab
commit 742cd0b5b6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 14 additions and 0 deletions

View File

@ -22,6 +22,17 @@
<div hx-swap-oob="innerHTML:.total-object-count">{{ table.rows|length }}</div>
{% endif %}
{# Announce the updated result count to assistive technology #}
{% if not table.embedded %}
<div hx-swap-oob="innerHTML:#object-list-status">
{% blocktrans trimmed count count=table.page.paginator.count %}
{{ count }} result found
{% plural %}
{{ count }} results found
{% endblocktrans %}
</div>
{% endif %}
{# Include the updated "save" link for the table configuration #}
{% if table.config_params and not table.embedded %}
<a class="dropdown-item" hx-swap-oob="outerHTML:#table_save_link" href="{% url 'extras:tableconfig_add' %}?{{ table.config_params }}&return_url={{ request.path }}" id="table_save_link">{% trans "Save" %}</a>

View File

@ -1,6 +1,9 @@
{% load helpers %}
{% load i18n %}
{# Live region used to announce updated results (e.g. after a quick search) to assistive technology #}
<div id="object-list-status" class="visually-hidden" role="status" aria-live="polite"></div>
<div class="row mb-3" id="results">
<div class="col-auto d-print-none">
<div class="input-group input-group-flat me-2 quicksearch" hx-disinherit="hx-select hx-swap">