-
Notifications
You must be signed in to change notification settings - Fork 542
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
Updates ActionList async filter example to be accessible #3808
Conversation
|
Uh oh! @mperrotti, the image you shared is missing helpful alt text. Check your pull request body. Alt text is an invisible description that helps screen readers describe images to blind or low-vision users. If you are using markdown to display images, add your alt text inside the brackets of the markdown image. Learn more about alt text at Basic writing and formatting syntax: images on GitHub Docs. |
size-limit report 📦
|
<VisuallyHidden | ||
isVisible={results.length === 0} | ||
aria-live="polite" | ||
aria-atomic="true" | ||
as={Text} | ||
sx={{display: 'block', fontSize: 1, m: 2}} | ||
> | ||
{results.length === 0 ? 'No branches match that query' : `${results.length} branches match that query`} | ||
</VisuallyHidden> |
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.
For live region support, we have an internal LiveRegion
component that we could try to consolidate on if it's helpful.
Right now it's not a standalone component (meaning it needs two components) but we could totally add a standalone variant to it that's just like <LiveRegion>The message</LiveRegion>
if it would be helpful for any live region based a11y fixes 👀
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.
Thanks for reminding me we had this! I just had to update LiveRegionOutlet
so we could visually show the No branches match that query
message.
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.
Left a couple of comments, just wanted to sorry about the confusion on my end!
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 we should keep the original behavior here as this file was created intentionally to differ from the other behavior so that VisuallyHidden
has no ability to not be hidden.
Instead, the intent was that if you need something to be VisuallyHidden you wrap it in the component. If not, you don't wrap it in VisuallyHidden.
Hope that makes sense!
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.
So should we plan to remove the older VisuallyHidden
component without preserving the isVisible
prop? I can open a separate PR for that.
<LiveRegion> | ||
<LiveRegionOutlet isVisible={results.length === 0} /> | ||
{results.length === 0 ? ( | ||
<Text sx={{display: 'block', fontSize: 1, m: 2}}>No branches match that query</Text> | ||
) : ( | ||
`${results.length} branches match that query` | ||
)} | ||
</LiveRegion> |
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.
Ah, sorry I confused this earlier where the message here would be visible (I totally misread the VisuallyHidden
helper 🤦♂️)
The LiveRegion module currently is intended to mirror the helper that exists upstream in dotcom in that it's a visually hidden part of the page. Specifically, things passed as children
to the Message
component are analogous to the "announce" helper.
The important part about this is because, for certain live regions types, they must always be in the DOM as dynamically adding them can cause certain Screen Readers to not announce as expected 😞
For visible content that also is considered a live region, it would be worth having helpers for the status/alert roles (or just practices to follow). In this case, it could be:
<LiveRegion> | |
<LiveRegionOutlet isVisible={results.length === 0} /> | |
{results.length === 0 ? ( | |
<Text sx={{display: 'block', fontSize: 1, m: 2}}>No branches match that query</Text> | |
) : ( | |
`${results.length} branches match that query` | |
)} | |
</LiveRegion> | |
<div role="status"> | |
{results.length === 0 | |
? <Text sx={{display: 'block', fontSize: 1, m: 2}}>No branches match that query</Text> | |
: <VisuallyHidden>`${results.length} branches match that query`</VisuallyHidden> | |
</div> |
Would need to test to double-check, but I think that should satisfy the same thing as aria-live="polite" aria-atomic="true"
and would keep the live region persistent in the DOM. Curious what you think @mperrotti and @ericwbailey 👀
4b196cb
to
36a4591
Compare
Thanks @joshblack ! I think I addressed your feedback correctly. I removed my changes to |
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!
Related issue: https://github.com/github/accessibility-audits/issues/4487
<label>
for the text input and removes theplaceholder
textChangelog
This is just a documentation update, no changes need to be released.
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.