Skip to content

[6.x] Fix Bard set dropdowns closing right after opening - #15709

Merged
jasonvarga merged 1 commit into
statamic:6.xfrom
o1y:bard-ignore-aria-hidden
Oct 23, 2026
Merged

jasonvarga merged 1 commit into
statamic:6.xfrom
o1y:bard-ignore-aria-hidden

Conversation

@o1y

@o1y o1y commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #15704, alternative PR to #15690

Menus on Bard sets could close right after opening and the page scroll jumped. This happens when a set contains an aria-live region, for example the keyboard reorder status of a Replicator (#15592), a multi-select with max_items configured or the avatar menu in the control panel header.

Modal overlays hide the rest of the page from screen readers with the aria-hidden package. That package keeps aria-live elements visible, so it walks into the editor and marks the top-level blocks with aria-hidden. ProseMirror treats this as an edit and redraws those blocks and destroys every set in between, including the one with the open menu.

This PR adds a small Bard extension that makes ProseMirror ignore changes to aria-hidden and data-aria-hidden. ProseMirror has no public hook for this, so the extension wraps its DOM observer, the same workaround suggested on the ProseMirror forum.

@jaygeorge

Copy link
Copy Markdown
Contributor

Looks good to me but this is outside my wheelhouse tbh!

I ran it against Opus 5.5 out of curiosity and it flagged one small thing:

"Might be worth a quick comment that registerMutation isn't public ProseMirror API, so whoever upgrades ProseMirror later knows to check it."

@jasonvarga
jasonvarga merged commit 5f9ed8f into statamic:6.x Oct 23, 2026
64 checks passed
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.

Bard: dropdown menu of a newly inserted set closes immediately (can't delete/collapse/duplicate the set)

3 participants