Skip to content

[6.x] Keep Bard sets alive when a dropdown opens inside them - #15690

Closed
edalzell wants to merge 1 commit into
statamic:6.xfrom
edalzell:fix/bard-set-dropdowns
Closed

edalzell wants to merge 1 commit into
statamic:6.xfrom
edalzell:fix/bard-set-dropdowns

Conversation

@edalzell

Copy link
Copy Markdown
Contributor

Opening any dropdown inside a Bard set (the set's own menu, a nested Replicator set's menu, a stacked Grid row's menu) recreates the set's NodeView and the menu closes immediately, whenever the set has other nodes on both sides of it. Reka's modal menu runs hideOthers, which stamps aria-hidden on every sibling along the trigger's ancestor path, including the editor's other top-level nodes. ProseMirror sees those attribute mutations on its own paragraph/heading DOM, re-parses the range between them, and the set in between is replaced. Nested fields lose their state, e.g. an expanded Replicator snaps shut.

Dropdown now renders non-modal when the existing isInBardField injection is present, so nothing inside the editor gets marked aria-hidden. Dropdowns elsewhere are unchanged. Verified in a sandbox with Playwright: all three menus open and the set element survives.

Related to #15687 (the remount that resets a nested Replicator's collapsed state); #15688 and #15689 cover the save-driven rebuilds.

@edalzell
edalzell requested a review from jaygeorge October 21, 2026 04:04
@o1y

o1y commented Oct 23, 2026

Copy link
Copy Markdown
Contributor

Hey Erin, I hit the same bug. Bard only gets touched because aria-hidden keeps aria-live regions visible, like the reorder announcers from #15592 inside sets.

So any modal overlay can trigger it: with this PR, when you e.g. opening the avatar menu in the header still rebuilds the sets ☠️ I opened #15709, which makes ProseMirror ignore aria-hidden changes and keeps menus modal. let me know what you think (:

@jaygeorge

Copy link
Copy Markdown
Contributor

Thanks both! Having looked at the two, I think #15709 is the one to go with. It fixes the underlying cause, catches the avatar menu case too, and keeps the menus modal for screen readers.

Erin, are you happy to close this one in favour of that?

@jasonvarga

Copy link
Copy Markdown
Member

(I'm sure he is)

@jasonvarga jasonvarga closed this Oct 23, 2026
@edalzell

Copy link
Copy Markdown
Contributor Author

I sure am, thanks @o1y for a better fix!!

@edalzell
edalzell deleted the fix/bard-set-dropdowns branch October 23, 2026 16:24
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.

4 participants