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

aria-label should not be set automatically for xc-button #184

Closed
PatrickVonMassow-GIP opened this issue May 8, 2024 · 0 comments · Fixed by #185
Closed

aria-label should not be set automatically for xc-button #184

PatrickVonMassow-GIP opened this issue May 8, 2024 · 0 comments · Fixed by #185
Assignees

Comments

@PatrickVonMassow-GIP
Copy link
Contributor

PatrickVonMassow-GIP commented May 8, 2024

Currently, the component xc-button automatically sets the aria-label as the value of the tag's content. There are two problems with this:

  • An aria-label should only be set when needed. In this case, it's unnecessary, because a screen reader would read the tag's content when no aria-label is set. A case where an aria-label is necessary is an xc-icon-button because it has no text.
  • In case of the xc-button, setting the aria-label is not only bad practice, but the way it's currently done is incorrect, because the aria-label is being set to the language key of the tag's content, instead of the translated value.

Solution: For xc-button, don't automatically set the aria-label to the tag's content. This still preserves the option to manually set an aria-label that differs from the tag's content, because xc-button has an optional input attribute xc-button-aria-label for this purpose.

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

Successfully merging a pull request may close this issue.

1 participant