Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove erroneous fieldset and fix aria description #1806

Merged
merged 2 commits into from
Oct 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
{% from "date-input/macro.njk" import govukDateInput %}
{% from "inset-text/macro.njk" import govukInsetText %}
{% set title = mssgs.dob_title_you if data.isLicenceForYou else mssgs.dob_title_other %}
{% set describedByTag = "date-of-birth-hint" %}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wondering if way to do this in route so can test?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As I see this, it's the id for an element on the page which is passed to a sub-template. As such, I think we can get away with just having it in the template rather than needing to have it in the getData function. However, I do think that if we're using a variable in this way, the div with this id should use the variable rather than having the id hard-coded.


{%
set errorMap = {
Expand Down Expand Up @@ -40,11 +41,9 @@
%}

{% block pageContent %}
<fieldset class="govuk-fieldset" role="group" aria-describedby="passport-issued-hint">
<div id="passport-issued-hint" class="govuk-hint">
{{ mssgs.dob_entry_hint }}
</div>
</fieldset>
<div id="{{ describedByTag }}" class="govuk-hint">
{{ mssgs.dob_entry_hint }}
</div>

<div class="govuk-warning-text">
<span class="govuk-warning-text__icon" aria-hidden="true">!</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
{% block notificationContent %}{% endblock %}

{% call govukFieldset({
describedBy: describedByTag,
legend: {
text: title,
classes: "govuk-fieldset__legend--l govuk-!-margin-bottom-3",
Expand All @@ -25,7 +26,7 @@
{% block pageContent %}{% endblock %}

{% endcall %}

{{ govukButton({
attributes: { id: 'continue' },
preventDoubleClick: true,
Expand All @@ -39,4 +40,3 @@
{% block pricingSummary %}{% endblock %}
</div>
{% endblock %}

Loading