-
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(copy-button): add aria-label for the copy button #4296
fix(copy-button): add aria-label for the copy button #4296
Conversation
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.
LGTM 👍 - Thanks @jendowns!
Deploy preview for carbon-elements ready! Built with commit e7c96e6 |
Deploy preview for carbon-components-react ready! Built with commit e7c96e6 https://deploy-preview-4296--carbon-components-react.netlify.com |
Deploy preview for the-carbon-components ready! Built with commit e7c96e6 https://deploy-preview-4296--the-carbon-components.netlify.com |
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 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?
Thank you @dakahn -- that makes a lot of sense. I just restored the |
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.
looks good to me, not seeing any more DAP violations
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.
Wonderful!
Closes #3734
The originating issue identified a labeling problem with the
CopyButton
, and also with theCopyButton
used inside the single-line and multi-lineCodeSnippet
variations.For the
CopyButton
, I added anaria-label
. (Thearia-label
on the inner svg can be removed, in this case.) This removes the DAP violation for theCopyButton
.For the single- and multi-line
CodeSnippet
, the fix for theCopyButton
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 #3734Changelog
Changed
aria-label
in theCopyButton
CodeSnippet
storybook demo