Skip to content

[6.x] Modal remove behind from accessibility tree - #15569

Merged
jasonvarga merged 3 commits into
6.xfrom
modal-remove-behind-from-accessibility-tree
Oct 7, 2026
Merged

jasonvarga merged 3 commits into
6.xfrom
modal-remove-behind-from-accessibility-tree

Conversation

@jaygeorge

Copy link
Copy Markdown
Contributor

Description of the Problem

When the license modal is active, the page behind stays in the accessibility tree.

What this PR Does

  • This is related to Licensing alert blocks the CP but has no dialog role, name, inert page, or Escape handler #15393, fixing the accessibility tree being available when the licensing dialogue shows.
  • The PR removes everything behind the modal from the accessibility tree - aria-hidden hides everything except the dialog so the page behind leaves the accessibility tree.
    • Initially I explored using inert but apparently this diverges from the Reka way of doing things, and not necessarily simpler
  • Keeps the page aria-hidden until the modal leave animation finishes
  • Declare aria-hidden as a direct dependency. Modal imports it directly; it should not rely on reka-ui hoisting it.

How to Reproduce

  1. On the broken branch run [] returned, which means that these nodes are not hidden from the accessibility tree.
  2. On the fix branch run [...document.querySelectorAll('#statamic > [aria-hidden="true"]')] .map(el => el.tagName + (el.id ? '#' + el.id : '')) and you should see ['DIV', 'HEADER', 'MAIN#main'] returned, which means the DOM is hidden from the accessibility tree.

…-hidden hides everything except the dialog so the page behind leaves the accessibility tree; the overlay stays clickable. Cleared on close.
Revealing on close() put the page back in the accessibility tree while the dialog was still visible and focus-trapped. Reveal in cleanup() after the 300ms wait instead.
Modal imports it directly; it should not rely on reka-ui hoisting it.
@jasonvarga
jasonvarga merged commit ab79cc5 into 6.x Oct 7, 2026
65 checks passed
@jasonvarga
jasonvarga deleted the modal-remove-behind-from-accessibility-tree branch October 7, 2026 20:37
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.

2 participants