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 accessible names for navigation buttons #8338

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

tagliala
Copy link
Contributor

Close #8328


Please let me know if:

  • you prefer aria-label to sr-only (but that would use I18n in an attribute, which is something that is not present at the moment
  • translation keys should be moved
  • translations should change

Copy link

codecov bot commented May 15, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.10%. Comparing base (58ce54c) to head (6eb2d10).
Report is 3 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #8338   +/-   ##
=======================================
  Coverage   99.10%   99.10%           
=======================================
  Files         140      140           
  Lines        4018     4018           
=======================================
  Hits         3982     3982           
  Misses         36       36           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@javierjulio javierjulio left a comment

Choose a reason for hiding this comment

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

I'm fine with either. Is the aria-label the recommended approach? If so, then we should use that.

If we label these buttons, wouldn't we need to label others like the main navigation?

The upgrading guide should also be updated to include the new locale keys.

@tagliala
Copy link
Contributor Author

tagliala commented May 17, 2024

I'm fine with either. Is the aria-label the recommended approach? If so, then we should use that.

That's a good question. I'm not sure

  1. Bootstrap uses aria-label for its main navigation button
  2. Tailwind uses aria-labelledby with references to a visually hidden label near the button
  3. One of the first google results is https://gomakethings.com/revisting-aria-label-versus-a-visually-hidden-class/ (which is 4 year old), and it suggest to use sr-only

If we label these buttons, wouldn't we need to label others like the main navigation?

That's correct. Since that button is not visible in large desktop, it was not spotted by lighthouse

The upgrading guide should also be updated to include the new locale keys.

Will do that

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

v4: add accessible names for buttons
2 participants