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: Improve accessibility of async items #2429
Conversation
🦋 Changeset detectedLatest commit: b1b0766 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
size-limit report 📦
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great! Left some questions/comments, it was awesome to see how it reads on NVDA 🔥
// Show loading indicator after a short delay | ||
React.useEffect(() => { | ||
if (state === 'loading') { | ||
timeoutId.current = safeSetTimeout(() => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems like since we're having to manually manage the timer that we could use setTimeout
and clearTimeout
directly. Is there something that safeSetTimeout
is doing here that's nice to have?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think safeSetTimeout
is a thin wrapper around setTimeout
to make sure all timeouts get cleaned up when a component unmounts. Not sure if there are downsides to using safeSetTimeout
here instead of setTimeout
directly
Addressing a11y feedback from https://github.com/github/primer/issues/815#issuecomment-1273922579
👉 Try it out
Changes
aria-live
region (based on @ericwbailey's guidance)state
prop toTreeView.SubTree
to support thearia-live
region implementationCleanShot.2022-10-12.at.19.21.59.mp4
Merge checklist
Take a look at the What we look for in reviews section of the contributing guidelines for more information on how we review PRs.