Skip to content
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

Merged
merged 21 commits into from
Jan 6, 2020
Merged

Conversation

dakahn
Copy link
Contributor

@dakahn dakahn commented Dec 11, 2019

Closes #4427

Changelog

New

  • added button reset to styling
  • added AAT tests for DAP and Axe
  • added AAT tests for aria-label

Changed

  • changed <span role="button"> to simply <button>
  • title prop is now used in aria-label
  • updated Storybook story to be more clear

Removed

  • removed aria-label on close icon
  • removed title attribute on filtered Tag

Testing / 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

@dakahn dakahn requested a review from a team as a code owner December 11, 2019 22:37
@ghost ghost requested review from asudoh and joshblack December 11, 2019 22:37
@dakahn dakahn requested a review from abbeyhrt December 11, 2019 22:38
@netlify
Copy link

netlify bot commented Dec 11, 2019

Deploy preview for the-carbon-components ready!

Built with commit 846bd21

https://deploy-preview-4863--the-carbon-components.netlify.com

packages/react/src/components/Tag/Tag-test.js Outdated Show resolved Hide resolved
) : (
<span className={tagClasses} {...other}>
<button className={tagClasses} {...other}>
Copy link
Contributor

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?

Copy link
Contributor Author

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}`
Copy link
Contributor

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>

Copy link
Contributor Author

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

Copy link
Contributor Author

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.

packages/react/src/components/Tag/Tag-test.js Outdated Show resolved Hide resolved
@netlify
Copy link

netlify bot commented Dec 11, 2019

Deploy preview for carbon-elements ready!

Built with commit 4f8795a

https://deploy-preview-4863--carbon-elements.netlify.com

@netlify
Copy link

netlify bot commented Dec 11, 2019

Deploy preview for the-carbon-components ready!

Built with commit 4f8795a

https://deploy-preview-4863--the-carbon-components.netlify.com

@netlify
Copy link

netlify bot commented Dec 11, 2019

Deploy preview for carbon-components-react ready!

Built with commit 4f8795a

https://deploy-preview-4863--carbon-components-react.netlify.com

Copy link
Contributor

@abbeyhrt abbeyhrt left a 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 dakahn requested a review from joshblack December 17, 2019 19:51
@joshblack
Copy link
Contributor

@dakahn looks like it hit the following test failure:

image

@dakahn
Copy link
Contributor Author

dakahn commented Dec 18, 2019

Yeah, looks like if the tested element contains text it needs to be wrapped in a <main> tag moving forward 👍

@asudoh
Copy link
Contributor

asudoh commented Dec 18, 2019

@dakahn Is this PR ready for re-review? Thanks!

@joshblack joshblack merged commit 0d5c573 into carbon-design-system:master Jan 6, 2020
joshblack added a commit to joshblack/carbon that referenced this pull request Jan 6, 2020
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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

AVT 3 - Tag w/ Filter React Component VO on macOS and iOS the Clear Filter button is not announced correctly.
4 participants