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

Fix fallback logo so Chrome will not flag it to screen readers #1724

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
2 changes: 1 addition & 1 deletion src/govuk/components/button/template.njk
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
{#- The SVG needs `focusable="false"` so that Internet Explorer does not
treat it as an interactive element - without this it will be
'focusable' when using the keyboard to navigate. #}
<svg class="govuk-button__start-icon" xmlns="http://www.w3.org/2000/svg" width="17.5" height="19" viewBox="0 0 33 40" role="presentation" focusable="false">
<svg class="govuk-button__start-icon" xmlns="http://www.w3.org/2000/svg" width="17.5" height="19" viewBox="0 0 33 40" aria-hidden="true" focusable="false">
<path fill="currentColor" d="M0 0h13l20 20-20 20H0l20-20z"/>
</svg>
{% endset %}
Expand Down
2 changes: 1 addition & 1 deletion src/govuk/components/footer/template.njk
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
treat it as an interactive element - without this it will be
'focusable' when using the keyboard to navigate. #}
<svg
role="presentation"
aria-hidden="true"
focusable="false"
class="govuk-footer__licence-logo"
xmlns="http://www.w3.org/2000/svg"
Expand Down
2 changes: 1 addition & 1 deletion src/govuk/components/header/template.njk
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
treat it as an interactive element - without this it will be
'focusable' when using the keyboard to navigate. #}
<svg
role="presentation"
aria-hidden="true"
focusable="false"
class="govuk-header__logotype-crown"
xmlns="http://www.w3.org/2000/svg"
Expand Down
4 changes: 2 additions & 2 deletions src/govuk/components/header/template.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,8 @@ describe('header', () => {
expect($svg.attr('focusable')).toEqual('false')
})

it('sets role="presentation" so that it is ignored by assistive technologies', () => {
expect($svg.attr('focusable')).toEqual('false')
it('sets aria-hidden="true" so that it is ignored by assistive technologies', () => {
expect($svg.attr('aria-hidden')).toEqual('true')
})

describe('fallback PNG', () => {
Expand Down