-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
[core] feat(Icon): add aria-hidden for unlabeled icons #4835
Conversation
Thanks for your interest in palantir/blueprint, @evansjohnson! Before we can accept your pull request, you need to sign our contributor license agreement - just visit https://cla.palantir.com/ and follow the instructions. Once you sign, I'll automatically update this pull request. |
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.
this seems like the right direction w/r/t icon aria attributes. there are some more cases we need to consider:
- icon-only buttons without text/children (need a way to send
title
to the rendered<Icon>
) - "double-caret-vertical" icon inside
<HTMLSelect>
needs a title <KeyCombo>
icons probably need titles<TimePicker>
arrow icons probably need titles
did a pass at the extra cases you mentioned, I did search through every only one I didn't add for now:
|
Regarding |
I am reconsidering one of the suggestions I made earlier:
I believe this turns out to be superfluous. icon-only buttons without text/children should have their a11y labels set with |
Fixes #4793
Checklist
Changes proposed in this pull request:
set
aria-hidden="true"
onIcon
s that don't have atitle
defined.this is a change in documented behavior though I think it may be reasonable to view the previous behavior as undesired for accessibility and so okay to change within a major version. previously
desc
was set to the icon's name which wasn't formatted. perhaps screen readers handle this but I wonder ifless-than-or-equal-to
is read aslessdashthandashordashequaldashto
(any way to check this?). regardless of whether that is handled, I think it's a better default to not announce every icon.it could be considered to release this as part of v4 to include guidance in the upgrade notes that standalone icons without other text should now provide the
title
prop to be labeled appropriatelyReviewers should focus on:
opinion on if this is an appropriate thing to do. I started off setting
aria-hidden
for decorative icons but realized it was almost all of themScreenshot