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

docs-bug(cdk/accordion): Accordion example code uses ARIA attributes incorrectly, cannot be operated using keyboard #30041

Open
cartr opened this issue Nov 19, 2024 · 0 comments
Labels
area: cdk/accordion docs This issue is related to documentation P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent

Comments

@cartr
Copy link

cartr commented Nov 19, 2024

Documentation Feedback

The example code displayed for the CDK accordion component contains some accessibility issues:

  • Each entire accordion item is given role="button" -- so when it's open, the accordion body is considered part of the accordion item's name. (This also makes it invalid to put interactive elements inside the accordion.)
  • The accordion items are focusable, but there's no way to open/close them using the keyboard.

The code should probably look more like the WAI-ARIA accordion example, where the header (not the entire accordion item) is a <button> that gets the aria-expanded and aria-controls attributes. This seems to be how <mat-expansion-panel> works already.

Affected documentation page

https://material.angular.io/cdk/accordion/examples

@cartr cartr added docs This issue is related to documentation needs triage This issue needs to be triaged by the team labels Nov 19, 2024
@crisbeto crisbeto added P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent area: cdk/accordion and removed needs triage This issue needs to be triaged by the team labels Nov 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: cdk/accordion docs This issue is related to documentation P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent
Projects
None yet
Development

No branches or pull requests

2 participants