fix(a11y): keep portaled Thinking menu inside aria-modal (D7) - #57
Merged
Conversation
Mount PortalDropdown into the modal overlay so D1 inert no longer orphans the menu outside the dialog. Co-authored-by: Cursor <cursoragent@cursor.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthrough
Possibly related PRs
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
Comment |
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.
Summary
Closes #51 ([a11y][D7]). The Thinking menu was relocated to
document.bodyto escape the scrolling settings modal. After D1, non-overlay body children are markedinert, so the open menu was outside thearia-modaldialog and inert for AT and keyboard users.Spike
Two options from the audit / resolution plan:
aria-owns— keep body portal; point the toggle at the menu.popover/ top layer (or otherwise keep the menu in the dialog subtree); possibly deleteportal-dropdown.js.Choice: keep the portal, but mount into the nearest
.modal-overlay(sibling of.modal-dialog) instead ofdocument.body. Falls back tobodywhen there is no modal.aria-ownsis not enough here: D1's bodyinertobserver still removes a body-portaled menu from the interaction tree. Fullpopoverrewrite would also work, but this is the smaller change that restores containment, clears inert, and keeps the existing positioning / clipping behavior.Changes
PortalDropdown.getPortalRoot()prefers.modal-overlayNo design-system change. D2–D5 / A6 / A9 left alone.
Test plan
npm test(D7 harness: menu parent is the overlay; not under[inert]; select High while modal open)menu inside dialog: true(wasfalse); no baseline shrink (axe counts unchanged)