test(focus-scope): shadow root issue example#2331
Draft
ldelhommeau wants to merge 1 commit intounovue:v2from
Draft
test(focus-scope): shadow root issue example#2331ldelhommeau wants to merge 1 commit intounovue:v2from
ldelhommeau wants to merge 1 commit intounovue:v2from
Conversation
commit: |
1ebd207 to
30fc625
Compare
This was referenced Dec 23, 2025
30fc625 to
dc77f08
Compare
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.
#1667
This is a reproduction branch about the focus isse mentionnedn in #1667 :
What is not working
When rendering a
Dialogcomponent (or anything that can be teleported) into the shadow root.Then rendering another component that will update the DOM (here a combobox opening a list) at some point.
If we have the focus on the inner component (e.g. combobox) when the DOM is updated, we loose the focus.
How to reproduce
pnpm story:devExpected behaviour
The focus should not be lost.
Here is an example of how it should behave.
Note
Here everything is teleported into the body so it's working. It would be nice to have it working inside the shadow-root:
Screen.Recording.2025-12-10.at.11.41.27.mp4
Faulty behaviour
Here, everything is mounted into shadow-root, the portal target as well. So the
Dialogoverlay and content will mount inside the portal-target within shadow root. TheComboboxwill be mounted inside theDialogcontent, and its list will be rendered inline.The focus is lost when we start typing and the list is shown:
Screen.Recording.2025-12-10.at.11.40.14.1.mp4