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

aria-label for heading menu duplicates information provided by the aria-expanded attribute #3696

Closed
Tracked by #3946
dav-idc opened this issue May 25, 2023 · 3 comments · Fixed by #3791
Closed
Tracked by #3946
Assignees
Labels
accessibility audit may 2023 Issues from May 2023 external accessibility audit against WCAG 2.2 criteria header
Milestone

Comments

@dav-idc
Copy link

dav-idc commented May 25, 2023

This issue is from May 2023 external accessibility audit report.

Usability issue

A menu button contained additional text which is not required.

Issue ID:
DAC_Usability_Menu_Button_01

URLs:
https://govuk-frontend-pr-3503.herokuapp.com/full-page-examples/task-list

Screen shots

close-up of a collapsed header menu, taken from the task-list full page example page.

The menu button has been provided with an ‘aria-label’ adding the phrase ‘show or hide’ to the accessible name. However, as the ‘aria-expanded’ already conveys the functionality and current state, the show or hide text may add some confusion.

Current code ref(s)

body > header > div > div.govuk-header__content > nav > button

<button type="button" class="govuk-header__menu-button govuk-js-header-toggle" aria-controls="navigation" aria-label="Show or hide menu" aria-expanded="true">Menu</button>

User comments

No user comment provided.

Solution

Consider removing the ‘show or hide’ from the accessible name and just use ‘menu’ in conjunction with the ‘aria-expanded’, as this already conveys the appropriate functionality and state of the component.

@dav-idc dav-idc added accessibility audit may 2023 Issues from May 2023 external accessibility audit against WCAG 2.2 criteria labels May 25, 2023
@36degrees 36degrees changed the title aria-abel for heading menu duplicates information provided by the aria-expanded attribute aria-label for heading menu duplicates information provided by the aria-expanded attribute Jun 2, 2023
@36degrees 36degrees changed the title aria-label for heading menu duplicates information provided by the aria-expanded attribute aria-label for heading menu duplicates information provided by the aria-expanded attribute Jun 2, 2023
@querkmachine
Copy link
Member

Seems like a simple fix, but to overthink it for a bit:

If we change the label to only read 'Menu' then the default aria-label is going to be identical to the button text, which becomes another (arguable) redundancy. This would also mean we have three separate Nunjucks parameters that default to to the text 'Menu': navigationLabel, menuButtonLabel and menuButtonText.

Should we do something to make it so that the aria-label attribute is only set if the value is provided and that value is different from the text of the button?

@36degrees
Copy link
Member

@querkmachine I'm assuming #3791 wasn't a breaking change as it's listed as a fix in the release notes? Just wondering whether we should backport it and release it in v4.70.

@36degrees 36degrees added this to the v5.0 milestone Jun 19, 2023
@querkmachine
Copy link
Member

@36degrees Not a breaking change to my eyes, no.

It could be bumped to a recommended change to remove the aria-label if it's the same as the button text, as that's redundant, but even then there's no harm by it still being present that I'm aware of.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accessibility audit may 2023 Issues from May 2023 external accessibility audit against WCAG 2.2 criteria header
Projects
Development

Successfully merging a pull request may close this issue.

3 participants