-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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(Tag): adds various fixes for screen reader accessibility; adds AAT #4863
fix(Tag): adds various fixes for screen reader accessibility; adds AAT #4863
Conversation
Deploy preview for the-carbon-components ready! Built with commit 846bd21 https://deploy-preview-4863--the-carbon-components.netlify.com |
) : ( | ||
<span className={tagClasses} {...other}> | ||
<button className={tagClasses} {...other}> |
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.
Do the other tag types need to be a button
?
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.
Nah, I don't think so. They're non-interactable generally.
aria-label={ | ||
title !== undefined | ||
? `${title} ${children}` | ||
: `Clear filter ${children}` |
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.
Is this so that we don't have a mismatch with the visual and accessible labels? Would there a preferred way to separate these or is this the ideal? Would we ever want something like:
<span class="tag">
<button>Clear</button>
Text for tag
</span>
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.
Well, since we don't technically have a visual label for the X icon remove button this was just so it spoke clearly (as defined in the issue) in VO etc
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.
title is -- not what we want here, but removing or not incorporating the prop is a breaking change.
Deploy preview for carbon-elements ready! Built with commit 4f8795a |
Deploy preview for the-carbon-components ready! Built with commit 4f8795a https://deploy-preview-4863--the-carbon-components.netlify.com |
Deploy preview for carbon-components-react ready! Built with commit 4f8795a https://deploy-preview-4863--carbon-components-react.netlify.com |
Co-Authored-By: Josh Black <[email protected]>
Co-Authored-By: Josh Black <[email protected]>
Co-Authored-By: Josh Black <[email protected]>
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 was only able to test on Safari and Chrome with VO since I don't have access to a Windows VM but it was good in those browsers!
@dakahn looks like it hit the following test failure: |
Yeah, looks like if the tested element contains text it needs to be wrapped in a |
@dakahn Is this PR ready for re-review? Thanks! |
carbon-design-system#4863) * fix(filter): add role button and update story for clarity * fix(tag): change span to button, remove role and add button-reset helper * fix(tag): add button-reset to tag styling * test(tag): add Axe test * fix(tag): remove unused aria, title, tab-index; add DAP * test(tag): add busted unit tests for screenreader HALP * test(tag): add aria-label test * Update packages/react/src/components/Tag/Tag-test.js Co-Authored-By: Josh Black <[email protected]> * Update packages/react/src/components/Tag/Tag-test.js Co-Authored-By: Josh Black <[email protected]> * Update packages/react/src/components/Tag/Tag-test.js Co-Authored-By: Josh Black <[email protected]> * Update packages/react/src/components/Tag/Tag-test.js Co-Authored-By: Josh Black <[email protected]> * test(tags): add less specific check for children for aria-label * test(tag): add <main> wrapper for DAP test element Co-authored-by: Josh Black <[email protected]>
Closes #4427
Changelog
New
aria-label
Changed
<span role="button">
to simply<button>
title
prop is now used inaria-label
Removed
aria-label
on close icontitle
attribute on filtered TagTesting / Reviewing
Tester should verify:
A) component speaks properly in JAWS latest on Windows 10 in Chrome, Edge, and Firefox latest
B) component speaks properly in VoiceOver on Safari in macOS and iOS
C) #4427 is satisfied