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(copy-button): add aria-label for the copy button #4296

Merged
merged 5 commits into from
Oct 11, 2019
Merged

fix(copy-button): add aria-label for the copy button #4296

merged 5 commits into from
Oct 11, 2019

Conversation

jendowns
Copy link
Contributor

@jendowns jendowns commented Oct 10, 2019

Closes #3734

The originating issue identified a labeling problem with the CopyButton, and also with the CopyButton used inside the single-line and multi-line CodeSnippet variations.

  • For the CopyButton, I added an aria-label. (The aria-label on the inner svg can be removed, in this case.) This removes the DAP violation for the CopyButton.

  • For the single- and multi-line CodeSnippet, the fix for the CopyButton helps, plus I also made sure to include default values for the a11y-related props in those storybook demos. This removes the DAP violations identified in AVT 1 - Single line, Multi line CodeSnippet, and CopyButton has DAP violation #3734

Changelog

Changed

  • use aria-label in the CopyButton
  • add default values for a11y props in the CodeSnippet storybook demo

@jendowns jendowns requested a review from a team as a code owner October 10, 2019 21:13
@ghost ghost requested review from jnm2377 and joshblack October 10, 2019 21:13
@jendowns jendowns changed the title 3734 copy button a11y fix(copy-button): use aria-label for the copy button Oct 10, 2019
@asudoh asudoh requested a review from dakahn October 10, 2019 21:14
Copy link
Contributor

@asudoh asudoh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍 - Thanks @jendowns!

@netlify
Copy link

netlify bot commented Oct 10, 2019

Deploy preview for carbon-elements ready!

Built with commit e7c96e6

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

@netlify
Copy link

netlify bot commented Oct 10, 2019

Deploy preview for carbon-components-react ready!

Built with commit e7c96e6

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

@netlify
Copy link

netlify bot commented Oct 10, 2019

Deploy preview for the-carbon-components ready!

Built with commit e7c96e6

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

Copy link
Contributor

@dakahn dakahn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we totally need an aria-label for this icon button and I agree the tooltip we get for title isn't up to spec (should be displayed on focus, be persistent, dismissable etc).

That said having a poorly accessible tooltip is better than none at all here I think -- if for no one else than our sighted users who expect this interaction. Can we wait to remove the title attribute and open a ticket to add our Tooltip component to CopyButton and remove title with that work?

@jendowns
Copy link
Contributor Author

Thank you @dakahn -- that makes a lot of sense. I just restored the title attribute in my latest commit 👍

@jendowns jendowns changed the title fix(copy-button): use aria-label for the copy button fix(copy-button): add aria-label for the copy button Oct 11, 2019
Copy link
Member

@emyarod emyarod left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good to me, not seeing any more DAP violations

Copy link
Contributor

@dakahn dakahn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wonderful!

@asudoh asudoh merged commit 173d51f into carbon-design-system:master Oct 11, 2019
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 1 - Single line, Multi line CodeSnippet, and CopyButton has DAP violation
4 participants