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

2411 the aria keyshortcuts is wrongly attached for the actionlistlinkitem components #2657

Conversation

green6erry
Copy link
Contributor

@green6erry green6erry commented Dec 6, 2022

Closes 2411

Removes this disparity of aria-keyshortcuts value, which when from mnemonics, was being assigned to the <li> wrapper of LinkItem, whereas if it was aria-keyshortcuts was manually defined, it would assign to the inner <a> element (creating two keyboard shortcuts that looked like they were selecting the same element, but were not). This also applies the correct prop role="menuitem" to the <a> element instead of the <li> in Link Item.

Screenshots

image
Previously, in this above example, pressing "u" would make the wrapper <li> active, and "d" would make the inner <a> active. Now, "u" doesn't do anything as the mnemonic keyshortcut is overridden by the user defined "d".

Changelog

Updated

  • Updated LinkItem to use either mnemonic or user defined aria-keyshortcuts to select the <a> tag within
  • Updated LinkItem so that the role="menuitem" is being assigned to correctly selectable DOM element inner <a> instead of the wrapper <li>

Merge checklist

  • Added/updated tests
  • Added/updated documentation
  • Tested in Chrome
  • Tested in Firefox
  • Tested in Safari
  • Tested in Edge

@changeset-bot
Copy link

changeset-bot bot commented Dec 6, 2022

🦋 Changeset detected

Latest commit: bd6dbc8

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@primer/react Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions
Copy link
Contributor

github-actions bot commented Dec 6, 2022

size-limit report 📦

Path Size
dist/browser.esm.js 82.8 KB (+0.05% 🔺)
dist/browser.umd.js 83.45 KB (+0.04% 🔺)

@green6erry green6erry temporarily deployed to github-pages December 6, 2022 18:21 Inactive
@github-actions github-actions bot temporarily deployed to storybook-preview-2657 December 6, 2022 18:22 Inactive
@green6erry green6erry temporarily deployed to github-pages December 6, 2022 18:58 Inactive
@github-actions github-actions bot temporarily deployed to storybook-preview-2657 December 6, 2022 18:59 Inactive
@green6erry green6erry temporarily deployed to github-pages December 6, 2022 19:29 Inactive
@github-actions github-actions bot temporarily deployed to storybook-preview-2657 December 6, 2022 19:30 Inactive
@green6erry green6erry temporarily deployed to github-pages December 7, 2022 16:08 — with GitHub Actions Inactive
@github-actions github-actions bot temporarily deployed to storybook-preview-2657 December 7, 2022 16:08 Inactive
…actionlistlinkitem-components' of github.com:primer/react into 2411-the-aria-keyshortcuts-is-wrongly-attached-for-the-actionlistlinkitem-components
@green6erry green6erry temporarily deployed to github-pages December 7, 2022 18:53 — with GitHub Actions Inactive
@github-actions github-actions bot temporarily deployed to storybook-preview-2657 December 7, 2022 18:54 Inactive
@green6erry green6erry marked this pull request as ready for review December 7, 2022 18:56
@green6erry green6erry requested review from a team and JoshBowdenConcepts December 7, 2022 18:56
@green6erry green6erry temporarily deployed to github-pages December 8, 2022 20:54 — with GitHub Actions Inactive
@github-actions github-actions bot temporarily deployed to storybook-preview-2657 December 8, 2022 20:54 Inactive
Copy link
Member

@joshblack joshblack left a comment

Choose a reason for hiding this comment

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

Looks great! 🥳

@joshblack joshblack requested review from siddharthkp and removed request for siddharthkp December 9, 2022 16:55
@joshblack
Copy link
Member

cc @siddharthkp would love to hear any thoughts you might have on this approach for handling the aria-keyshortcuts on ActionList.LinkItem from the parent item. It seems like this should work but wasn't sure the full scope of how this component is used.

@green6erry green6erry temporarily deployed to github-pages December 12, 2022 16:41 — with GitHub Actions Inactive
@github-actions github-actions bot temporarily deployed to storybook-preview-2657 December 12, 2022 16:42 Inactive
@green6erry green6erry temporarily deployed to github-pages December 12, 2022 21:45 — with GitHub Actions Inactive
@github-actions github-actions bot temporarily deployed to storybook-preview-2657 December 12, 2022 21:45 Inactive
@green6erry green6erry temporarily deployed to github-pages December 13, 2022 14:52 — with GitHub Actions Inactive
@green6erry green6erry merged commit cc909dc into main Dec 13, 2022
@green6erry green6erry deleted the 2411-the-aria-keyshortcuts-is-wrongly-attached-for-the-actionlistlinkitem-components branch December 13, 2022 15:22
@primer-css primer-css mentioned this pull request Dec 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

The aria-keyshortcuts is wrongly attached for the ActionList.LinkItem components
2 participants