added errors focus

This commit is contained in:
Beverly Nguyen
2024-12-09 18:47:34 -08:00
parent 28a6b44a98
commit 2fb4b7538c
4 changed files with 19 additions and 3 deletions

View File

@@ -483,6 +483,7 @@ def send_one_off_step(service_id, template_id, step_index):
link_to_upload=(
request.endpoint == "main.send_one_off_step" and step_index == 0
),
errors = form.errors if form.errors else None
)

View File

@@ -2,7 +2,6 @@
{% from "components/banner.html" import banner_wrapper %}
{% from "components/page-header.html" import page_header %}
{% from "components/components/button/macro.njk" import usaButton %}
{% from "components/components/skip-link/macro.njk" import usaSkipLink %}
{% from "components/components/back-link/macro.njk" import usaBackLink %}
{% set file_contents_header_id = 'file-preview' %}

View File

@@ -3,7 +3,6 @@
{% from "components/table.html" import list_table, field, text_field, hidden_field_heading %}
{% from "components/page-header.html" import page_header %}
{% from "components/components/button/macro.njk" import usaButton %}
{% from "components/components/skip-link/macro.njk" import usaSkipLink %}
{% from "components/components/back-link/macro.njk" import usaBackLink %}
{% set file_contents_header_id = 'file-preview' %}

View File

@@ -12,6 +12,23 @@
{{ usaBackLink({ "href": back_link }) }}
{% endblock %}
{% block skipLink %}
{% if errors %}
<div>
{{ usaSkipLink({
"href": '#main-content',
"text": 'Skip to main content'
}) }}
</div>
{% else %}
{{ usaSkipLink({
"href": '#main-content',
"text": 'Skip to main content'
}) }}
{% endif %}
{% endblock %}
{% block maincolumn_content %}
{{ page_header(page_title) }}
@@ -24,7 +41,7 @@
data_kwargs={'force-focus': True}
) %}
<div class="grid-row">
<div class="grid-col-12 {% if form.placeholder_value.label.text == 'phone number' %}extra-tracking{% endif %}">
<div class="grid-col-12 {% if form.placeholder_value.label.text == 'phone number' %}extra-tracking{% endif %}" aria-live="polite" role="alert">
{{ form.placeholder_value(param_extensions={"classes": ""}) }}
</div>
{% if skip_link or link_to_upload %}