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

TreeView: Use roving tabIndex for focus management #2443

Merged
merged 15 commits into from
Oct 18, 2022

Conversation

colebemis
Copy link
Contributor

@colebemis colebemis commented Oct 17, 2022

Replaced aria-activedescendant with a roving tab index in TreeView based on feedback from the accessibility engineering review.

This is not a consumer-facing change. The keyboard navigation should work the same as it did before.

👉 Try it out

CleanShot.2022-10-17.at.15.09.52.mp4

Known issue

If you focus on a loading item and the async request fails, focus is lost after closing the error dialog:

CleanShot.2022-10-17.at.15.14.56.mp4

I'll fix this in a separate PR.

Merge checklist

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

Take a look at the What we look for in reviews section of the contributing guidelines for more information on how we review PRs.

@changeset-bot
Copy link

changeset-bot bot commented Oct 17, 2022

🦋 Changeset detected

Latest commit: d7967da

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 Patch

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

@colebemis colebemis temporarily deployed to github-pages October 17, 2022 19:58 Inactive
@github-actions
Copy link
Contributor

github-actions bot commented Oct 17, 2022

size-limit report 📦

Path Size
dist/browser.esm.js 77.91 KB (0%)
dist/browser.umd.js 78.55 KB (0%)

@colebemis colebemis temporarily deployed to github-pages October 17, 2022 20:13 Inactive
@colebemis colebemis temporarily deployed to github-pages October 17, 2022 20:36 Inactive
@colebemis colebemis temporarily deployed to github-pages October 17, 2022 22:02 Inactive
@colebemis colebemis marked this pull request as ready for review October 17, 2022 22:18
@colebemis colebemis requested review from a team and rezrah October 17, 2022 22:18
@colebemis colebemis temporarily deployed to github-pages October 17, 2022 22:18 Inactive
@colebemis colebemis temporarily deployed to github-pages October 17, 2022 23:38 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.

Nice! From the implementation perspective, it's nice to see how much simpler this becomes. Excited to see how it reads compared to active descendant 👀

<>
<VisuallyHidden role="status" aria-live="polite">
{ariaLiveMessage}
</VisuallyHidden>
<UlBox
ref={containerRef}
tabIndex={0}
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor

@kendallgassner kendallgassner left a comment

Choose a reason for hiding this comment

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

We appreciate this thank you 😄 !


case 'ArrowRight':
event.preventDefault()
event.stopPropagation()
Copy link
Contributor

Choose a reason for hiding this comment

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

@colebemis colebemis temporarily deployed to github-pages October 18, 2022 16:13 Inactive
@colebemis colebemis merged commit 3012fae into main Oct 18, 2022
@colebemis colebemis deleted the treeview-roving-tabindex branch October 18, 2022 16:25
@primer-css primer-css mentioned this pull request Oct 18, 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.

3 participants