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

Add aria-label attribute to main navigation in the sidebar component #5251

Conversation

rainerdema
Copy link
Contributor

Summary

Fix failed specs in products_spec.rb by adding aria-label to sidebar navigation.
The aria-label attribute is set to "main-nav" to provide an accessible label for the main navigation section of the page.
https://dequeuniversity.com/rules/axe/4.7/landmark-unique?application=axeAPI

Screenshot 2023-07-17

Checklist

Check out our PR guidelines for more details.

The following are mandatory for all PRs:

The following are not always needed:

  • 📖 I have updated the README to account for my changes.
  • 📑 I have documented new code with YARD.
  • 🛣️ I have opened a PR to update the guides.
  • ✅ I have added automated tests to cover my changes.
  • 📸 I have attached screenshots to demo visual changes.

The `aria-label` attribute is set to "main-nav" to provide an accessible label
for the main navigation section of the page.
@rainerdema rainerdema added the type:bug Error, flaw or fault label Jul 17, 2023
@rainerdema rainerdema self-assigned this Jul 17, 2023
@rainerdema rainerdema requested a review from a team as a code owner July 17, 2023 07:06
@github-actions github-actions bot added the changelog:repository Changes to the repository not within any gem label Jul 17, 2023
Copy link
Contributor

@waiting-for-dev waiting-for-dev left a comment

Choose a reason for hiding this comment

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

Thanks for checking it, @rainerdema!

The nav element already conveys the "navigation" semantics. I found the error comes when two unlabelled nav elements exist. I'm not an expert in a11y, but I understand it's more important to label those with a specific scope. For instance, I added the label for the account links.

I guess you're finding this issue when working on the pagination, so maybe we could add an aria-label equal to "Pagination" there. What do you think?

@rainerdema
Copy link
Contributor Author

Thanks for checking it, @rainerdema!

The nav element already conveys the "navigation" semantics. I found the error comes when two unlabelled nav elements exist. I'm not an expert in a11y, but I understand it's more important to label those with a specific scope. For instance, I added the label for the account links.

I guess you're finding this issue when working on the pagination, so maybe we could add an aria-label equal to "Pagination" there. What do you think?

That absolutely makes sense! Thanks, @waiting-for-dev, I'll close the PR.

@rainerdema rainerdema closed this Jul 17, 2023
@waiting-for-dev waiting-for-dev deleted the nebulab/rainerd/fix-products-feature-spec branch July 17, 2023 07:42
@elia elia added changelog:solidus_admin and removed changelog:repository Changes to the repository not within any gem labels Jul 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants