-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Icon - aria-hidden="true" applied when as="a" is specified #2652
Comments
This is an interesting problem, because there's no text content related to icons, they should be hidden, even if they are an anchor. What would probably be better is not to show aria-hidden if an aria-label is applied to the icon. |
I have recently learned that assistive technologies rely on aria attributes to explain to impaired users what the element does. As an anchor with no content used for an icon, an aria-label can be used to describe the link. Even with an aria-label, the aria-hidden is still true. |
On mobile, sorry. *Renders as an |
Looks like there is consensus on:
PRs welcome! |
I was actually coming to file an issue requesting a way to provide aria-label for icons so that they are not invisible to the blind, since they have real meaning. However, if I understand that i18n will need to be considered: We use react-intl, so we would want to do something like: <Icon
label={formatMessage({ id: 'icon.email' })}
name="at"
/> Yields <i
aria-label="email"
class="icon at"
title="email" // might as well help the sighted too whilst we're at it
></i> |
Hey, would love to offer my help here. Just to make sure i understand the expected behaviour, the 'aria-hidden="true"' attribute should be applied unless aria-label attribute was passed. |
@benbakhar correct, I'm hesitant to recommend the label="" route because other components explicitly use aria-label and we should be consistent. It's also good documentation to place aria-label on a component so people reading it know what it's doing. |
Steps
OR
Expected Result
Actual Result
Version
0.78.3
Testcase
https://codesandbox.io/s/qq2vr3x2qj
The text was updated successfully, but these errors were encountered: