patternfly / patternfly-elements

PatternFly Elements. A set of community-created web components based on PatternFly design.
https://patternflyelements.org/
MIT License
378 stars 96 forks source link

[bug] <pf-accordion> Accessibility: arrow keys inside nested accordions don't work as expected #2490

Closed markcaron closed 1 year ago

markcaron commented 1 year ago

When navigating an accordion inside another accordion, the arrow keys don't move through the nested accordion. Instead, they jump up to the parent accordion.

image

Steps to reproduce:

  1. Run accordion demo locally
  2. Find nested example
  3. Expand first accordion item
  4. Tab inside to the child accordion
  5. Hit the down arrow (assuming it should go to the next item in the child accordion)
  6. Focus jumps to the parent accordion header
bennypowers commented 1 year ago

@nikkimk what's the expected behaviour here? wai-aria guidelines say that UP/down switch between headers, but don't mention switching between headers of separate instances of accordion

nikkimk commented 1 year ago

@bennypowers arrow keys should only work on one level of accordion at a time. There would be a tab to the panel where the accordion is nested. Once the nested accordion has focus, then it would be arrow keys. (Jump links is different from accordion because the nesting occurs within the same parent structure, there is no tab key to get to the children.)

bennypowers commented 1 year ago

should have been fixed by #2493