-
-
Notifications
You must be signed in to change notification settings - Fork 78.9k
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
Fix accessibility of examples buttons #37498
Conversation
I am also currently wondering if adding |
maybe a slicker way around it is to add <button ... aria-label="Try" title="Try it on StackBlitz">
<svg class="bi"><use xlink:href="#lightning-charge-fill"/></svg>
</button> as for |
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.
See comment about adding the aria-label
to the <button>
and removing the aria-hidden
as well
also, note that
is perhaps not completely accurate. They're not pure decoration, they represent the content/label of the button... but that's probably splitting hairs |
Ok with your version and for your opinion about However I think it will be better to keep the same content in the two attributes:
|
depending on browser/assistive technology used, both the accessible name and description may be announced, resulting in an overly verbose announcement (though, at least with Chrome/NVDA and Chrome/Jaws, it seems that if both are exactly the same, it's only announced once). Will test some more later just to check... |
I've actually just tested it, and it seems that consistently browsers use/expose Long story short, after more testing (also in Firefox/Win and Safari/macOS), ignore my suggestion. This will be fine as is ;) |
also, i'd note that those buttons were accessible even before this, but they did lead to an unnecessarily verbose announcement (along the lines of "image Try it, button, Try it on StackBlitz"). so this PR is more of a nice tweak ("Try it on StackBlitz, button") |
Description
Fix accessibility of 'Try it on StackBlitz' and 'Copy to clipboard' buttons.
Motivation & Context
Svgs inside 'Try it on StackBlitz' and 'Copy to clipboard' buttons are pure decoration so they must be ignored by any assistive technology.
See https://www.w3.org/TR/WCAG21/#non-text-content for more details.
Type of changes
Checklist
npm run lint
)Live previews