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

adds aria-hidden to labels that show on small screens, to avoid scree… #942

Merged
merged 4 commits into from
May 30, 2024
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

:wrench: **Fixes**

- Adds aria-hidden to labels in responsive tables that show only on small screens, to avoid screenreaders calling out them out twice ([PR 942](https://github.com/nhsuk/nhsuk-frontend/pull/942))
- Removing classes from icon card that are not doing anything
- Align label bottom margins with fieldset legend bottom margins ([PR 946](https://github.com/nhsuk/nhsuk-frontend/pull/946)).
- Fixed bug with inset-text component requiring uppercase `html` argument. Fixes [Issue 950](https://github.com/nhsuk/nhsuk-frontend/issues/950).
Expand Down
18 changes: 9 additions & 9 deletions packages/components/tables/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -199,35 +199,35 @@ Find out more about the table component and when to use it in the [NHS digital s
<tbody class="nhsuk-table__body">
<tr role="row" class="nhsuk-table__row" >
<td role="cell" class="nhsuk-table__cell">
<span class="nhsuk-table-responsive__heading">Age </span>3 to 5 months (weighing more than 5kg)
<span class="nhsuk-table-responsive__heading aria-hidden="true"">Age </span>3 to 5 months (weighing more than 5kg)
</td>
<td role="cell" class="nhsuk-table__cell">
<span class="nhsuk-table-responsive__heading">How much? </span>2.5ml
<span class="nhsuk-table-responsive__heading" aria-hidden="true">How much? </span>2.5ml
</td>
<td role="cell" class="nhsuk-table__cell">
<span class="nhsuk-table-responsive__heading">How often? </span>Max 3 times in 24 hours
<span class="nhsuk-table-responsive__heading" aria-hidden="true">How often? </span>Max 3 times in 24 hours
</td>
</tr>
<tr role="row" class="nhsuk-table__row" >
<td role="cell" class="nhsuk-table__cell">
<span class="nhsuk-table-responsive__heading">Age </span>6 to 11 months
<span class="nhsuk-table-responsive__heading" aria-hidden="true">Age </span>6 to 11 months
</td>
<td role="cell" class="nhsuk-table__cell">
<span class="nhsuk-table-responsive__heading">How much? </span>2.5l
<span class="nhsuk-table-responsive__heading" aria-hidden="true">How much? </span>2.5l
</td>
<td role="cell" class="nhsuk-table__cell">
<span class="nhsuk-table-responsive__heading">How often? </span>Max 3 to 4 times in 24 hours
<span class="nhsuk-table-responsive__heading" aria-hidden="true">How often? </span>Max 3 to 4 times in 24 hours
</td>
</tr>
<tr role="row" class="nhsuk-table__row" >
<td role="cell" class="nhsuk-table__cell">
<span class="nhsuk-table-responsive__heading">Age </span>1 to 3 years
<span class="nhsuk-table-responsive__heading" aria-hidden="true">Age </span>1 to 3 years
</td>
<td role="cell" class="nhsuk-table__cell">
<span class="nhsuk-table-responsive__heading">How much? </span>5ml
<span class="nhsuk-table-responsive__heading" aria-hidden="true">How much? </span>5ml
</td>
<td role="cell" class="nhsuk-table__cell">
<span class="nhsuk-table-responsive__heading">How often? </span>Max 3 times in 24 hours
<span class="nhsuk-table-responsive__heading" aria-hidden="true">How often? </span>Max 3 times in 24 hours
</td>
</tr>
</tbody>
Expand Down
2 changes: 1 addition & 1 deletion packages/components/tables/template.njk
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
{%- if params.responsive %}
{%- for cell in row %}
<td role="cell" class="nhsuk-table__cell{% if cell.format %} nhsuk-table__cell--{{ cell.format }}{% endif %}">
<span class="nhsuk-table-responsive__heading">{{cell.header}} </span>{{ cell.html | safe if cell.html else cell.text }}
<span class="nhsuk-table-responsive__heading" aria-hidden="true">{{cell.header}} </span>{{ cell.html | safe if cell.html else cell.text }}
</td>
{%- endfor %}
{%- else %}
Expand Down
Loading