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

AVT 1 - Code Snippet -> Inline has a DAP violation #4529

Closed
snidersd opened this issue Nov 1, 2019 · 8 comments
Closed

AVT 1 - Code Snippet -> Inline has a DAP violation #4529

snidersd opened this issue Nov 1, 2019 · 8 comments

Comments

@snidersd
Copy link

snidersd commented Nov 1, 2019

Environment

macOS Mojave version 10.14.6
Chrome Version Version 77.0.3865.90
Carbon v10 - React
DAP IBM Accessibility 1.8.0.0 Sept 2019 Ruleset

Detailed Description

Go to the React Component
Run DAP and the following violations are present (see screenshot):
Screen Shot 2019-11-01 at 12 20 22 PM

Note: "node -v" which is the button text does not match the aria-label="copyable code snippet".

@snidersd snidersd added this to the CodeSnippet - A11y Project Team milestone Nov 1, 2019
@joshblack joshblack self-assigned this Nov 20, 2019
@joshblack
Copy link
Contributor

@snidersd what would the expected resolution be in this case? Seems like we'd want to communicate that the button action is to copy, but having it announce copy node -v may be unintended as it would announce the entire code snippet.

@dakahn
Copy link
Contributor

dakahn commented Nov 21, 2019

Seems like DAP is incorrectly picking up our code text as it's visible label. When really, an inline code snippet has no visible label -- only a programmatic one excluding it from 2.5.3
https://www.w3.org/WAI/WCAG21/Understanding/label-in-name.html

@joshblack
Copy link
Contributor

Waiting for confirmation on approach from IBMa

@dakahn dakahn modified the milestones: CodeSnippet - A11y Project Team, Carbon WCAG Compliance Nov 21, 2019
@snidersd
Copy link
Author

snidersd commented Dec 5, 2019

@joshblack @dakahn Confirmed that this was discussed with IBMa and the DAP violation is valid, since the code snippet is still considered a visible label.

@dakahn
Copy link
Contributor

dakahn commented Dec 5, 2019

The internally proposed solution seems to be include the code to be copied in the programmatic label like aria-label="copy code snippet <div>...

This doesn't seem like it will scale very well considering there are no technical limits to our inline code snippet. Making the copy button distinct from the code it's acting on is probably the more usable move here I would think.

@elizabethsjudd
Copy link
Contributor

@dakahn @snidersd why not use remove the aria attributes and use the the assistive technology class on a span within the button? I've personally found it troublesome to use aria-label on elements like buttons and links.

@dakahn
Copy link
Contributor

dakahn commented Dec 18, 2019

@elizabethsjudd Oh, cool -- thanks for the suggestions we'll keep that in mind. We actually aren't looking to implement the suggested changes as they were proposed. Sometimes a code snippet can be quite long and having that read as a label isn't the experience we want here -- or at least we think it's not.

One idea we're kicking around is having a distinct (copy) button somewhere adjacent to the code. Would make more sense maybe than having the code be a button.

@jnm2377
Copy link
Contributor

jnm2377 commented Mar 17, 2021

Screen Shot 2021-03-17 at 5 36 41 PM

Testing latest carbon react, and I'm not seeing any a11y violations come up. I'm closing this issue for now, but we can re-open if we can reproduce later.

@jnm2377 jnm2377 closed this as completed Mar 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants