Accordion Keyboard behavior is broken
Describe the bug
The Accordion component doesn't follow the correct WAI-ARIA specification that's advertised in the documentation. Specifically, the Keyboard interactions.
The following interactions are failing:
- When using the arrow keys (
ArrowUp/ArrowDown),HomeandEnd, the focus is not being managed. - When using the
Escapekey, it always prevents default and stops the event, even if theAccordionis not collapsible. This is undocumented behavior of accordions closing onEscapeand it also breaks accordions inside ofDialogcomponents, for example.
To Reproduce
Steps to reproduce the behavior:
- Click the
Trigger. - Click an accordion trigger inside the modal.
- Press the
Escapekey, the modal isn't closed. - Press arrow keys,
Home,Endand see no focus changes. - See error.
Expected behavior
- The arrow keys (
ArrowUp/ArrowDown),HomeandEndshould behave according to their spec. - If the
Escapekey behavior is kept, it should be documented and, ideally, you should be able to control how it handles the event instead of having an implicit event.
Screenshots If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
- OS: Ubuntu 22.04
- Browser: Chrome
- Version: 132
Yup, I get the same. The documentation for WAI-ARIA does provide that the arrow and home/end interactions are optional, but the Kobalte documentation implies that these interactions are supported (perhaps they were previously? perhaps in particular environments/conditions they are? unsure).
Agreed wrt to the Escape button interactions.
Behaviour is also reproducible on the kobalte docs page. The issue doesn't exist with other components that have arrow key interactions.
Windows; Chrome