Repository navigation
fix(overlay): follow the pointer inside a shadow root while picking - #306
Merged
Merged
Conversation
Moving between elements in one shadow root fires no mouseover at the document, so the pick highlight stayed on the first component. The picker now also listens for pointermove and redraws only when the component under the pointer changes.
Contributor
🚀 Deploying Preview to Cloudflare 🚀Preview Deployments by commit
|
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.
What and why
#285 made the component picker pick components inside a
ShadowDomcomponent. A browser check found one gap. Moving the pointer between elements inside the same shadow root fires nomouseoverat the document, because both the target and the related target retarget to the shadow host. The hover box therefore stayed on whichever component the pointer entered first. Clicking still picked the right component.The picker now also listens for
pointermoveand works out the component under the pointer from the composed path, as before. It redraws the box only when that component changes, so moving within one component doesn't callhighlight.showagain.How it was verified
pnpm commit:checkpnpm format:check(changed files)pnpm typecheckpnpm test:devtools(1606 tests). The new test "follows the pointer between components inside one shadow root" fails without the change.pnpm skills:check(when.claude/changed): not changedpnpm extension:build(whenapp/changed): not changedScreenshots
None. The highlight box looks the same as before.
Notes for reviewers
mouseoverstays as well, so jsdom tests and browsers without Pointer Events keep working.mouseoutto outside the page still clears the box and resets the remembered component.Summary by CodeRabbit