-
-
Notifications
You must be signed in to change notification settings - Fork 659
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
Accordion Accessibility #2941
Comments
Hi! 😊 Thank you so much for opening this issue and making changes to the closed PR. I think we can take it step by step, starting with small improvements to enhance the overall experience. I’d suggest simply replacing the Additionally, we could add styles for a, button, .btn {
&:focus-visible {
outline: // ... ???
}
} What do you think about this approach? |
Hi! |
I would be happy if you could create a PR and check it. |
Description:
The accordion component has accessibility issues for keyboard-only users. While the first accordion is expanded by default, its header is not focusable. As a result, users cannot collapse it using the keyboard. However, the headers of the other accordions are not focusable, making the items inside the other accordions completely inaccessible — they cannot be focused, selected, or interacted with using the
Tab
key.Steps to Reproduce:
Tab
key — it cannot be focused.Enter
orSpace
to collapse it — this does not work.Tab
key to navigate to the headers of the other accordions — the headers are not focusable.Expected Behavior:
Tab
key.Enter
orSpace
.Possible Solution:
Make Headers Focusable:
Add
tabindex
to headers so they can be focused using theTab
key.Add
role="button"
:Define the functionality of headers for assistive technologies.
Enable Keyboard Navigation:
Add
keydown
listeners to toggle the accordion withEnter
orSpace
.Add Focus Styles:
Use CSS to clearly highlight headers when focused.
Why is this Important:
The current behavior renders the accordion component inaccessible for keyboard-only users and violates WCAG accessibility guidelines. Ensuring keyboard navigation accessibility is vital for providing an inclusive and user-friendly experience.
The text was updated successfully, but these errors were encountered: