goetzrobin / spartan

Cutting-edge tools powering Angular full-stack development.
https://spartan.ng
MIT License
1.31k stars 137 forks source link

Arrow Keys do not work when multiple accordions are present #68

Closed elite-benni closed 9 months ago

elite-benni commented 9 months ago

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

Which package are you modifying?

What is the current behavior?

When 2 accordions are on the app, the arrowkeys of the focusmanager stops working. This can be seen on spartan.ng. When switching from Documentation to Accordion the accordion ArrowDown does not work. This ist because the id is used to set the activeElement-index of the Focusmanager, which is not correct.

Closes #

What is the new behavior?

The ArrowDown now selects the next Trigger. The Focusmanager is set by the Item instead of the Item.id. Instead of document.activeElement we now use the FocusMonitor to determine if the accordion is focused.

Does this PR introduce a breaking change?

Other information