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

Rule 2ee8b8 ("Visible label is part of accessible name"): adding label text as part of visible label for labelable elements #2236

Open
shunguoy opened this issue Jan 28, 2025 · 0 comments

Comments

@shunguoy
Copy link

Using label elements to associate text labels with form controls (e.g., radio, checkbox) is common, and may be required by WCAG. If a labeled element doesn't have a valid aria-label or aria-labelledby attribute, the text from the label element can be used as an accessible name. However, suppose a labeled element has an aria-label or aria-labelledby attribute. In that case, the accessible name is calculated from the aria-label or aria-labelledby, and this rule should be triggered (with an error) if the label text is not part of the accessible name.
For example,
email:

Also, refer to #2075 for more discussions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant