Files
notifications-admin/app/templates/components/live-search.html
Tom Byers 43935457d8 Change live-search so it announces results
If there is a search term when the page loads, a
statement about the results is added to the
searchbox label.

All subsequent searches are announced via an aria
live-region.
2020-09-17 14:38:40 +01:00

22 lines
678 B
HTML

{% from "components/textbox.html" import textbox %}
{% macro live_search(
target_selector=None,
show=False,
form=None,
label=None
) %}
{%- set search_label = label or form.search.label.text %}
{% if show %}
<div data-module="autofocus">
<div class="live-search js-header" data-module="live-search" data-targets="{{ target_selector }}">
{{ form.search(param_extensions={
"label": {"text": search_label},
"autocomplete": "off"
}) }}
<div role="region" aria-live="polite" class="live-search__status govuk-visually-hidden"></div>
</div>
</div>
{% endif %}
{% endmacro %}