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

Use aria-labelledby and an appended element if lang attribute present. #9

Open
joedolson opened this issue Oct 10, 2023 · 2 comments
Open
Labels
a11y Accessibility

Comments

@joedolson
Copy link

Per the HTML spec and assistive technology behavior, the aria-label of an element is announced using the language of the html element, and ignores any lang attribute defined on the element itself. Because of this, putting the text into an aria-label attribute can create a language of parts violation.

@SteveJonesDev SteveJonesDev added the a11y Accessibility label Oct 10, 2023
@SteveJonesDev
Copy link
Member

@joedolson, would screen reader text be a more straightforward solution?

@joedolson
Copy link
Author

Screen reader text is more straightforward, and has the advantage that it's available when CSS fails. The CSS always annoys me when adding any front-end screen reader text, since you pretty much always have to add potentially duplicate CSS, but 🤷.

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

No branches or pull requests

2 participants