Skip to content

Fix/expandable group init new items - #659

Merged
flacoman91 merged 2 commits into
mainfrom
fix/expandable-group-init-new-items
Dec 3, 2026
Merged

flacoman91 merged 2 commits into
mainfrom
fix/expandable-group-init-new-items

Conversation

@flacoman91

@flacoman91 flacoman91 commented Dec 3, 2026 •

Copy link
Copy Markdown
Collaborator

Fixes: #655

Update to the other PR that @soroush5 did for us.

Changes to the PR fixes some things:

ExpandableGroup keeps its own ref on the group element, placed after {...properties}, so a ref passed by a caller cannot replace the node that Expandable.init uses. Without that, init would fall back to document and set up every expandable on the page.

The new test covers the accordion case the init checks missed.

It adds an item after mount, opens the original item, then opens the new one, and expects the first item to collapse. jsdom never finishes the design system's max-height transition, so the test dispatches the same transitionend event the design system listens for before checking aria-expanded.

@github-actions

github-actions Bot commented Dec 3, 2026 •

Copy link
Copy Markdown
PR Preview Action v1.8.2
Preview removed because the pull request was closed.
2026-12-03 18:08 UTC

@flacoman91
flacoman91 marked this pull request as ready for review December 3, 2026 17:53
@flacoman91
flacoman91 enabled auto-merge (squash) December 3, 2026 18:05
@flacoman91
flacoman91 merged commit 6792eaa into main Dec 3, 2026
3 checks passed
@flacoman91
flacoman91 deleted the fix/expandable-group-init-new-items branch December 3, 2026 18:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ExpandableGroup: expandables added after the group mounts are never initialized

3 participants