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

Closed
cartr opened this issue Nov 19, 2024 · 2 comments · Fixed by #30087
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
@Sepandard
Copy link
Contributor

Hi, everyone. Is anybody working on this issue? I can try to fix it if you don't mind.

Sepandard added a commit to Sepandard/components that referenced this issue Nov 26, 2024
Updated the example code for the CDK accordion component to address accessibility issues

resolves angular#30041
Sepandard pushed a commit to Sepandard/components that referenced this issue Nov 28, 2024
Updated the example code for the CDK accordion component to address accessibility issues

resolves angular#30041
Sepandard added a commit to Sepandard/components that referenced this issue Nov 28, 2024
Updated the example code for the CDK accordion component to address accessibility issues

resolves angular#30041
crisbeto pushed a commit that referenced this issue Nov 29, 2024
Updated the example code for the CDK accordion component to address accessibility issues

resolves #30041
crisbeto pushed a commit that referenced this issue Nov 29, 2024
Updated the example code for the CDK accordion component to address accessibility issues

resolves #30041

(cherry picked from commit de6c491)
Sepandard added a commit to Sepandard/components that referenced this issue Nov 30, 2024
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Dec 30, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
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

Successfully merging a pull request may close this issue.

3 participants