Repository navigation
[6.x] Fix Bard set dropdowns closing right after opening - #15709
Merged
Merged
Conversation
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.