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

[a11y]: AILabel has a11y Violation - Accessible name does not match or contain the visible label text #18204

Open
2 tasks done
2nikhiltom opened this issue Dec 5, 2024 · 2 comments

Comments

@2nikhiltom
Copy link
Contributor

2nikhiltom commented Dec 5, 2024

Package

@carbon/react

Browser

No response

Operating System

No response

Package version

1.72.0

React version

No response

Automated testing tool and ruleset

IBM Accessibility Checker version 3.1.75 onwards till latest deployment

Assistive technology

No response

Description

Checker throws Accessible name does not match or contain the visible label text Violation on [AILabel component ]

Violation only seen on IBM Accessibility Checker version 3.1.75 and later versions (seen on latest deployment as well )
(Here)

Visually, the button displays two spans: "AI" and "Text goes here"
The aria-label on button is set to "AI Text goes here" (with a space)

The space between "AI" and "Text goes here" creates a discrepancy between the visual text and the accessible name.
aria-label="AI Text goes here" -> removing the space in label fixes the violation

https://deploy-preview-17351--v11-carbon-react.netlify.app/iframe.html?args=&globals=&id=components-ailabel--default&viewMode=story
Image

WCAG 2.1 Violation

No response

Reproduction/example

https://deploy-preview-17351--v11-carbon-react.netlify.app/iframe.html?args=&globals=&id=components-ailabel--default&viewMode=story

https://react.carbondesignsystem.com/iframe.html?args=&globals=&id=components-ailabel--default&viewMode=story

Steps to reproduce

visit expandable AILabel storybook - https://react.carbondesignsystem.com/iframe.html?args=&globals=&id=components-ailabel--default&viewMode=story
run Accessibility Checker with 3.1.75 and later versions

Suggested Severity

None

Code of Conduct

@philljenkins
Copy link

philljenkins commented Dec 9, 2024

I'm not Yes I'm able to reproduce using the following:

Image

** I had previously tested the wrong page

@philljenkins
Copy link

my concern was why the aria-label= was being redundantly used?
The text is already visible and set as the "accessible name" on the button for everyone without the attribute.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: 🕵️‍♀️ Triage
Development

No branches or pull requests

2 participants