Skip to content

Fix modal dialogs being hidden from assistive technology by aria-hidden on the application root. #9865 - #10587

Closed
dpage wants to merge 1 commit into
pgadmin-org:masterfrom
dpage:fix/issue-9865-modal-aria-hidden-focus
Closed

dpage wants to merge 1 commit into
pgadmin-org:masterfrom
dpage:fix/issue-9865-modal-aria-hidden-focus

Conversation

@dpage

@dpage dpage commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

pgAdmin's dialogs are rendered in place (disablePortal) inside the
application root, but MUI's modal manager applied aria-hidden to the
children of , hiding the root and the dialog within it whilst the
dialog held focus. Chrome blocks this and logs a console error. Use the
dialog's own parent element as the modal container so only the
background content is hidden.

Closes #9865

Summary by CodeRabbit

  • Bug Fixes
    • Fixed confirmation dialogs so they remain accessible while open, background content is correctly hidden, and background content is restored when the dialog is dismissed. This keeps the dialog and its surrounding container available to assistive technologies while preventing background content from being exposed during the confirmation flow.

@coderabbitai

coderabbitai Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: pgadmin-org/pgadmin4/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 6985ce35-fefc-42c2-803c-dae94cd62b29
📥 Commits

Reviewing files that changed from the base of the PR and between b8c67f8 and 3a9cec3.

📒 Files selected for processing: 2
  • web/pgadmin/static/js/helpers/ModalProvider.jsx
  • web/regression/javascript/ModalProvider.spec.js

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.

Walkthrough

ModalContainer now uses the dialog’s parent element as the MUI modal container. A regression test checks that the dialog remains outside hidden content while open and that the background becomes visible after dismissal.

Changes

Modal accessibility

Layer / File(s) Summary
Set modal container and verify aria-hidden behavior
web/pgadmin/static/js/helpers/ModalProvider.jsx, web/regression/javascript/ModalProvider.spec.js
ModalContainer sets the MUI modal container to the dialog’s parent element. The test checks dialog focus, background hiding while the dialog is open, and background restoration after dismissal.

Priority: ➖ Normal

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix · Severity of issue fixed: Medium

Merge Risk: ⚪ Minimal · up to 3a9ce

The change keeps the active dialog exposed to assistive technology while hiding the background. No concrete merge-blocking risk was identified.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 2 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly identifies the main accessibility fix: preventing aria-hidden on the application root from hiding modal dialogs.
Linked Issues check Passed Issue #9865 requires the focused dialog to remain accessible to assistive technology. ModalContainer now passes the dialog parent as MUI's container while retaining disablePortal. The regression…
Out of Scope Changes check Passed The changes are limited to modal container handling and its regression test. Both changes directly support issue #9865. No unrelated changes are shown.
  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@dpage
dpage force-pushed the fix/issue-9865-modal-aria-hidden-focus branch from b8c67f8 to 3a10959 Compare October 15, 2026 09:44
…en on the application root. pgadmin-org#9865

pgAdmin's dialogs are rendered in place (disablePortal) inside the
application root, but MUI's modal manager applied aria-hidden to the
children of <body>, hiding the root and the dialog within it whilst the
dialog held focus. Chrome blocks this and logs a console error. Use the
dialog's own parent element as the modal container so only the
background content is hidden.

Closes pgadmin-org#9865
@dpage
dpage force-pushed the fix/issue-9865-modal-aria-hidden-focus branch from 3a10959 to 3a9cec3 Compare October 15, 2026 15:27
@dpage

dpage commented Oct 15, 2026

Copy link
Copy Markdown
Contributor Author

Squashed and merged as f73b51f.

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.

Accessibility Error: aria-hidden="true" conflict with focused descendant on <button> element.

1 participant