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

Navigation block should be identifiable with aria-label #24369

Closed
tellthemachines opened this issue Aug 5, 2020 · 11 comments · Fixed by #39161
Closed

Navigation block should be identifiable with aria-label #24369

tellthemachines opened this issue Aug 5, 2020 · 11 comments · Fixed by #39161
Assignees
Labels
[Block] Navigation Affects the Navigation Block [Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes). [Status] In Progress Tracking issues with work in progress [Type] Enhancement A suggestion for improvement.

Comments

@tellthemachines
Copy link
Contributor

Is your feature request related to a problem? Please describe.

The Navigation block allows us to have multiple instances of navigation on the same page, each of these wrapped in a <nav> tag. To make it easier for screen reader users to make sense of multiple navigations, each <nav> tag should have an aria-label indicating what its contents are, e.g. "Site navigation" or "Categories navigation".

It won't be easy to generate an aria-label based on the contents of the block, so we might have to depend on users adding it in as a setting.

Describe the solution you'd like

A setting in the Navigation block allowing us to add a title, or (very) short description of the purpose of that Navigation. The content of the field should then be added as aria-label on the <nav> tag.

@tellthemachines tellthemachines added [Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes). [Block] Navigation Affects the Navigation Block [a11y] Labelling labels Aug 5, 2020
@noisysocks noisysocks added the Needs Design Needs design efforts. label Aug 5, 2020
@ZebulanStanphill ZebulanStanphill added the [Type] Enhancement A suggestion for improvement. label Aug 10, 2020
@enriquesanchez enriquesanchez added the Good First Issue An issue that's suitable for someone looking to contribute for the first time label Aug 11, 2020
@brettkrueger
Copy link

Discussed in Navigation (screen and block) triage meeting

Unique auto-generating labels
https://wordpress.slack.com/archives/C02RQBWTW/p1597217654203300

Use of placeholder for enforcing field
https://wordpress.slack.com/archives/C02RQBWTW/p1597217840208300

@noisysocks noisysocks removed the Good First Issue An issue that's suitable for someone looking to contribute for the first time label Aug 14, 2020
@noisysocks
Copy link
Member

We need to display a text field which allows the user to name the Navigation. Because this field would likely need to display in the block inspector, we're blocked on #23934.

@tellthemachines
Copy link
Contributor Author

Hmm, in the links above we discussed adding the field in the placeholder so that it has to be filled in - that would display in the Navigation screen?

In any case, this issue is relevant to the Navigation block in general, so it's not blocked on all fronts 😄

@noisysocks
Copy link
Member

Let's pull the aria-label from a new menu name field shown in the toolbar. See #24581. This can work in both the Navigation screen and Navigation block.

@annezazu
Copy link
Contributor

annezazu commented Feb 7, 2022

Since a lot has changed with the nav block and it's been a minute since this issue was updated, I wanted to note that the current experience in WordPress 5.9 and Gutenberg 12.5.3 auto-names menus when creating new ones and gives you the option to update the name under Advanced. However, currently the aria label remains the same regardless (just shows as menu).

@carolinan
Copy link
Contributor

I do not see any aria-label on the nav element. When I select a named menu, I see the following:
<nav class="wp-container-6200d3af748ba is-responsive items-justified-right wp-block-navigation">
Gutenberg trunk is active.

@annezazu can you help me locate where the aria-label you mentioned is? Did you mean the one on the button element?
"Open menu" ?

@annezazu
Copy link
Contributor

annezazu commented Feb 7, 2022

Ah yes. Apologies :)

@tellthemachines
Copy link
Contributor Author

We could add an aria-label with the menu name. While it's possible that there is more than one instance of the same menu on a page, and so both menus will end up with the same aria-label, given that both menus will be identical in content, the repeated aria-label would indicate that. Does that make sense?

@getdave
Copy link
Contributor

getdave commented Feb 14, 2022

Let's pull the aria-label from a new menu name field shown in the toolbar. See #24581. This can work in both the Navigation screen and Navigation block.

@tellthemachines Should we proceed with what @noisysocks suggests?

@noisysocks
Copy link
Member

I wrote that comment a while ago 😅 just noting that we now have a field for the menu name underneath Advanced in the block inspector. Using that for the ARIA label makes sense to me.

@getdave
Copy link
Contributor

getdave commented Feb 15, 2022

@noisysocks I assumed that was the field you were referring to 😄 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Navigation Affects the Navigation Block [Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes). [Status] In Progress Tracking issues with work in progress [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

10 participants