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

[Admin] Make account navigation accessible #5265

Conversation

waiting-for-dev
Copy link
Contributor

Summary

We make it browsable by keyboard. We transform the user name to button so it can be focused and activated by the keyboard. We also render it before the links in the DOM so the next tab will focus on the first link. We close the dropdown when the focus leaves the last item.

We also make it more friendly for screen readers by using the aria-expanded
attribute to tell screen readers if the menu is expanded or not.

screencast-localhost_3000-2023.07.21-08_59_43.webm

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.

We make the user name a button so it can be focused and activated by
the keyboard. We also render it before the links in the DOM so the next tab
will focus on the first link. We close the dropdown when the focus
leaves the last item.
We use the corresponding `aria` attributes to tell screen readers that
there's an expandable menu.
@waiting-for-dev waiting-for-dev requested a review from a team as a code owner July 21, 2023 07:02
@github-actions github-actions bot added the changelog:repository Changes to the repository not within any gem label Jul 21, 2023
@waiting-for-dev waiting-for-dev self-assigned this Jul 21, 2023
@waiting-for-dev waiting-for-dev added the type:enhancement Proposed or newly added feature label Jul 21, 2023
Copy link
Member

@kennyadsl kennyadsl left a comment

Choose a reason for hiding this comment

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

👍 nice!

@waiting-for-dev waiting-for-dev merged commit e9051b3 into solidusio:nebulab/admin Jul 21, 2023
@waiting-for-dev waiting-for-dev deleted the waiting-for-dev/admin/accessible_account_nav branch July 21, 2023 10:06
@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
changelog:solidus_admin type:enhancement Proposed or newly added feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants