-
Notifications
You must be signed in to change notification settings - Fork 600
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-item focus behavior inside Accordion #6618
Comments
thanks for this @YonatanKra, I'd like to test this against the changes going into the main branch for accordion to see if the issue persists after the slight refactor. As a note for you and @yinonov our main branch is tracking our current alpha versions. The |
Thanks! Regarding the current issue with |
Totally open - I do want to figure out if it repro's in the latest implementations given we may wholesale take some of those fixes. Additionally we need to figure out the error in that branch preventing publishing. Feel free to throw a PR, but it may be held simply given the need to figure out the build error. |
@chrisdholt |
Unfortunately |
In Accordion, focusing on the child sets the private property
activeItemIndex
to the focused item's index.I've opened a PR to simplify the code (#6616 ), but then noticed some edge cases that could be troubling.
Because it sets the current active index, if I'm in
single
mode and change the items in the accordion it will open the focused item regardless of the state before the addition.Here's a unit test that shows the issue:
The
activeItemIndex
is used in thefocusItem
method that's supposed to set the focus to the current active item but it is also used to determine the current expanded item insetItems
:Is this the wanted behavior?
The text was updated successfully, but these errors were encountered: