-
Notifications
You must be signed in to change notification settings - Fork 1.4k
feat: Focus Management within ShadowDOM #6046
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
snowystinger
merged 146 commits into
adobe:main
from
ritz078:shadow-dom-enhancement-1-getRootNode
Feb 6, 2025
Merged
Changes from all commits
Commits
Show all changes
146 commits
Select commit
Hold shift + click to select a range
c026270
Add `getRootNode` utility.
MahmoudElsayad 9299cee
Update `getRootNode` util.
MahmoudElsayad 71836e3
Update `getOwnerWindow` util.
MahmoudElsayad 10893b9
Add tests for Shadow DOM handling using `getRootNode`.
MahmoudElsayad 5f81d34
Update comment.
MahmoudElsayad bfb9429
Fix FocusScope.tsx in Shadow DOM.
MahmoudElsayad 3448ed7
Add more test for FocusScope.test.js.
MahmoudElsayad 0c07404
Fix another `useRestoreFocus` issue with restoring focus in `Keyboard…
MahmoudElsayad 90906bf
Add tests for `getDeepActiveElement`
MahmoudElsayad 314fc44
Add `useFocus` shadow DOM tests.
MahmoudElsayad 9cb6c5a
Update `focusSafely`.
MahmoudElsayad 67399bb
Update `useInteractionOutside` for Shadow DOM support.
MahmoudElsayad 59c3705
Update `useFocusVisible` for Shadow DOM support.
MahmoudElsayad 3c85408
Add `useInteractOutside` tests.
MahmoudElsayad 61ba1b0
Add test for use case mentioned in issue #1472.
MahmoudElsayad 75d7fa5
Add tests for `usePress` hook.
MahmoudElsayad db45ef4
Update the fix for `useInteractOutside` to use simpler one.
MahmoudElsayad f9b94a3
Update `useOverlay` to use composedPath.
MahmoudElsayad 758575c
Tests refactor.
MahmoudElsayad 25ef5c5
Revert `useOverlay` changes as it works correctly without these changes.
MahmoudElsayad 0d4f70e
Fix types.
MahmoudElsayad 3cf2091
Merge branch 'main' into shadow-dom-enhancement-1-getRootNode
MahmoudElsayad 1d8c439
Fix types.
MahmoudElsayad e5dbda1
lint.
MahmoudElsayad ae7b76e
lint.
MahmoudElsayad aea5d8d
Fix failing tests.
MahmoudElsayad f2ca9b7
Fix failing tests.
MahmoudElsayad 4d6ff95
Fix failing tests.
MahmoudElsayad 4c53797
Test CI
MahmoudElsayad 85b7146
Test CI
MahmoudElsayad a001f2a
Fix shadow DOM tests
MahmoudElsayad d00f0b2
Fix shadow DOM tests.
MahmoudElsayad e875828
Fix CI?
MahmoudElsayad b483e61
Fix CI?
MahmoudElsayad b8ef055
Fix CI?
MahmoudElsayad cc2a7c4
Re-add commented test.
MahmoudElsayad 7447a79
Merge branch 'main' into shadow-dom-enhancement-1-getRootNode
ritz078 492d83f
Update `getRootNode` to handle iframes as well, and everything that …
MahmoudElsayad 139a209
Merge remote-tracking branch 'upstream/main' into shadow-dom-enhancem…
MahmoudElsayad 805561b
Merge branch 'main' into shadow-dom-enhancement-1-getRootNode
snowystinger a319991
Merge branch 'main' into shadow-dom-enhancement-1-getRootNode
MahmoudElsayad dc2231d
Fix tests.
MahmoudElsayad bd536b6
Fix tests?
MahmoudElsayad f1aa64a
Fix tests?
MahmoudElsayad 6426c08
Merge branch 'main' into shadow-dom-enhancement-1-getRootNode
MahmoudElsayad 7cafb6a
Merge branch 'main' into shadow-dom-enhancement-1-getRootNode
MahmoudElsayad 1a3e068
Fix tests.
MahmoudElsayad f1fe364
Fix tests.?
MahmoudElsayad 24550d6
Fix tests.?
MahmoudElsayad b9a11ee
Fix tests.?
MahmoudElsayad 97d73f2
Fix tests.?
MahmoudElsayad 720ee18
Merge branch 'main' into shadow-dom-enhancement-1-getRootNode
MahmoudElsayad 6f80dbc
Merge branch 'main' into shadow-dom-enhancement-1-getRootNode
snowystinger 6ca6996
Merge branch 'main' into shadow-dom-enhancement-1-getRootNode
snowystinger 1f6ecf3
Apply suggestions from code review
MahmoudElsayad 13278d9
Update packages/@react-aria/interactions/test/usePress.test.js
MahmoudElsayad 93a5071
- Update tests to use `createShadowRoot` util.
MahmoudElsayad 4ca6f75
Merge branch 'main' into shadow-dom-enhancement-1-getRootNode
MahmoudElsayad 9fa339d
- Update tests and remove reactCompat.
MahmoudElsayad 0586b9e
Merge branch 'main' into shadow-dom-enhancement-1-getRootNode
MahmoudElsayad 90e52b9
- Leftover.
MahmoudElsayad f2b2d18
Merge remote-tracking branch 'origin/shadow-dom-enhancement-1-getRoot…
MahmoudElsayad 717a8ab
- Revert changes to getFocusableTreeWalker.
MahmoudElsayad 979a542
- Remove casting.
MahmoudElsayad fbe8f89
- return null in case element is disconnected in `getRootNode`.
MahmoudElsayad bd22291
- Casting.
MahmoudElsayad 6548170
- Update unit test.
MahmoudElsayad db93e53
- Handle focus movements between shadow DOMs.
MahmoudElsayad 98e255e
- TS fixes.
MahmoudElsayad 820cd72
Merge remote-tracking branch 'upstream/main' into shadow-dom-enhancem…
MahmoudElsayad 580e1f0
Merge remote-tracking branch 'refs/remotes/upstream/main' into shadow…
MahmoudElsayad e15086e
Merge branch 'main' into shadow-dom-enhancement-1-getRootNode
MahmoudElsayad 9453cac
Update usePress.test.js
MahmoudElsayad debb4ba
Refactors and TS errors.
MahmoudElsayad cd6a2d7
Update fix.
MahmoudElsayad 7673da1
Remove broken sandbox link.
MahmoudElsayad a8773c1
Merge branch 'main' into shadow-dom-enhancement-1-getRootNode
MahmoudElsayad 60cb5da
Merge branch 'main' into shadow-dom-enhancement-1-getRootNode
snowystinger 8d2a6dd
Merge branch 'main' into shadow-dom-enhancement-1-getRootNode
snowystinger 52baba2
Merge branch 'main' into shadow-dom-enhancement-1-getRootNode
snowystinger afd28e9
Merge branch 'main' into shadow-dom-enhancement-1-getRootNode
MahmoudElsayad 173cb03
Refactor `getRootNode` to improve root node handling.
MahmoudElsayad 9d40d58
Use `getDeepActiveElement` inside focusSafely.ts to get the active el…
MahmoudElsayad 40cd5dd
Refactor event listener registration
MahmoudElsayad 72596b9
Merge branch 'main' into shadow-dom-enhancement-1-getRootNode
MahmoudElsayad ae30def
Remove `ownerDocument` fallback in usePress.ts
MahmoudElsayad c5ddb24
Refactor `createEventListener` for type-safe caching.
MahmoudElsayad 4ce0c1c
Merge branch 'main' into shadow-dom-enhancement-1-getRootNode
MahmoudElsayad d75d68f
Merge branch 'main' into shadow-dom-enhancement-1-getRootNode
MahmoudElsayad 2d84757
- Test out the updated getOwnerWindow to fix iframe focus issues.
MahmoudElsayad a690850
- Test out the updated getOwnerWindow to fix iframe focus issues.
MahmoudElsayad 638d7eb
- Test?
MahmoudElsayad 2c4a9bc
- Revert Focus scope changes, for testing.
MahmoudElsayad 9210f8e
- Fix tests?
MahmoudElsayad 3cb0874
- Fix tests?
MahmoudElsayad 0181bc3
- Fix tests?
MahmoudElsayad 930a2c3
- Revert the changes to getRootNode.
MahmoudElsayad 1cecef0
- Revert `isElementInScope` as well.
MahmoudElsayad 2bd25dd
- Test out if instance check failure across context for iframes is wh…
MahmoudElsayad bc7d188
- Replace the use of `instanceof` with `nodeType` to correctly identi…
MahmoudElsayad 3b6a4cd
- Fix ESlint errors.
MahmoudElsayad 6661416
Merge branch 'main' into shadow-dom-enhancement-1-getRootNode
MahmoudElsayad 18f0519
Merge branch 'main' into shadow-dom-enhancement-1-getRootNode
MahmoudElsayad 27d8d85
Merge branch 'main' into shadow-dom-enhancement-1-getRootNode
snowystinger 22e75e6
Merge branch 'main' into shadow-dom-enhancement-1-getRootNode
MahmoudElsayad 51932a5
- Update the usages of `instanceof` to use `nodeType` instead.
MahmoudElsayad 541dd5f
Update packages/@react-aria/interactions/src/useFocusVisible.ts
MahmoudElsayad 4b35260
Merge branch 'main' into shadow-dom-enhancement-1-getRootNode
MahmoudElsayad 3fa8c44
- Update the usages of `instanceof` to use `nodeType` instead.
MahmoudElsayad ab9f8db
- Lint.
MahmoudElsayad 47be393
- Lint.
MahmoudElsayad 54cfe24
- Update `getDeepActiveElement` to accept an optional document or sha…
MahmoudElsayad e918e38
Merge branch 'main' into shadow-dom-enhancement-1-getRootNode
MahmoudElsayad 95a6b64
- Add extra unit test for `getDeepActiveElement`.
MahmoudElsayad c830aab
- Update `getDeepActiveElement` to always rely on `getRootNode`.
MahmoudElsayad 319617f
- Update `getDeepActiveElement` to always rely on `getRootNode`.
MahmoudElsayad 3e1730e
Merge branch 'main' into shadow-dom-enhancement-1-getRootNode
MahmoudElsayad 0d0af54
Merge branch 'main' into shadow-dom-enhancement-1-getRootNode
snowystinger 563501a
Merge branch 'main' into shadow-dom-enhancement-1-getRootNode
snowystinger 5aeb024
Merge branch 'main' into shadow-dom-enhancement-1-getRootNode
snowystinger 03c23c4
refactor usePress to still have global listeners for cleanup across b…
snowystinger cf3f567
fix lint and test
snowystinger 64348e4
Merge branch 'main' into shadow-dom-enhancement-1-getRootNode
snowystinger fc82be0
restore remaining document level listeners
snowystinger b62d83f
fix tests
snowystinger 366565c
fix lint
snowystinger edc9892
simplify
snowystinger 9b08f75
Update packages/@react-aria/focus/src/FocusScope.tsx
snowystinger 39543de
Merge branch 'main' into shadow-dom-enhancement-1-getRootNode
snowystinger 4c4e006
fix autofocus
snowystinger bbdb342
Merge branch 'main' into shadow-dom-enhancement-1-getRootNode
snowystinger 96b9166
minor test updates to preserve test intent
LFDanLu 87b3542
review comments
snowystinger 650bf4a
fix esm test
snowystinger 1660aad
fix lint
snowystinger d90cc98
Merge branch 'main' into shadow-dom-enhancement-1-getRootNode
snowystinger c43a15e
Merge branch 'main' into shadow-dom-enhancement-1-getRootNode
snowystinger 0d962db
Merge branch 'main' into shadow-dom-enhancement-1-getRootNode
snowystinger 9bf04b1
check in speed tests
snowystinger 21b80bd
fix lint
snowystinger 5bf5bb7
Merge branch 'main' into shadow-dom-enhancement-1-getRootNode
snowystinger a4f35b1
Merge branch 'main' into shadow-dom-enhancement-1-getRootNode
snowystinger 4e42519
Merge branch 'main' into shadow-dom-enhancement-1-getRootNode
snowystinger 393c698
Add feature flag and fix a couple probable bugs
snowystinger 71e3d32
Merge branch 'main' into shadow-dom-enhancement-1-getRootNode
snowystinger dc4ca82
Update NOTICE.txt
snowystinger File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.