fix(react-aria): scope ariaHideOutside to target document - #10595
Open
dvd233 wants to merge 1 commit into
Open
Conversation
|
|
||
| it('should use the target document as the default root', function () { | ||
| let iframe = document.createElement('iframe'); | ||
| document.body.appendChild(iframe); |
Member
There was a problem hiding this comment.
to clarify, the bug was that the top level root document's body was getting hidden, which hides everything below it
however, this should probably be hiding siblings of the iframe still
can you add an element alongside the iframe and assert it's hidden?
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.
Closes #10581
Summary
Scope
ariaHideOutside's default root to the document that owns its first target instead of the module-globaldocument. This keeps modal and popover isolation within the secondary window/document where the overlay is rendered, while preserving the existing behavior when callers provide an explicit root or render in the main document.The implementation uses the
windowObjthatariaHideOutsidealready derives from the target. A regression test creates a second document, verifies that content beside the target is hidden there, and verifies that the opener document's body is not hidden.✅ Pull Request Checklist:
📝 Test Instructions:
Run:
The suite should pass all 25 tests. In the new
should use the target document as the default rootcase, verify that:aria-hidden="true";<body>remains untouched; andAdditional checks used locally:
All three pass. A repo-wide Jest run passed 7,989 tests; its 16 failures are confined to existing Windows path-separator expectations in
packages/dev/parcel-resolver-optimize-locales/test/LocalesResolver.test.js. The SSR run passed 59 of 60 suites, with the unrelated DatePicker SSR test timing out locally.🧢 Your Project:
N/A