-
Notifications
You must be signed in to change notification settings - Fork 598
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
Add aria-label to Spinner component #4226
Conversation
🦋 Changeset detectedLatest commit: 5f711be 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 📦
|
So interestingly, the loading spinner is used on TextInput (via TextInputInnerVisualSlot) - need to work out whether we want to make it aria-hidden or not 🤔 We can see this on the deployed storybook page |
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.
Hello @owenniblock 👋🏻 We have an open [github.com/github/primer/discussions/2976](Spinner API discussion) that @mperrotti created, sorry if you already know about it or discussed it somewhere else. I just wanted to make sure to link them and would love to understand their overlap.
Thank you!! 🙏🏻
@broccolinisoup I had not seen that, thanks for bringing it to my attention! |
Converting to draft because there's ongoing discussions about this component. |
Going to close this. We need to handle it differently anyway! |
Closes https://github.com/github/primer/issues/2202
This adds a new option for setting the accessible label of the Spinner component. When it's not provided, we default to "Loading" so you have to intentionally hide the element with
label=""
. Where we find Loading state is communicated to screenreader users twice in dotcom, we can set this label value to "", I have intentionally opted for the most accessible default so it over communicates rather than under-communicating the loading state.Changelog
New
label
option on Spinner component. Defaults to "Loading". When set (or left as default) it addsaria-label={label}
to the Spinner's svg.Adds
role="img"
to the svg element.If the
label
is set to an empty string, it addsaria-hidden='true'
to the svg element.Changed
Removed
Rollout strategy
Testing & Reviewing
Merge checklist