Skip to content
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

Fix LocalHints.getElementFromPoint for shadow roots containing only text #4621

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

sersorrel
Copy link

@sersorrel sersorrel commented Feb 3, 2025

Description

LocalHints.getElementFromPoint could return nothing if it's called on a shadow root element which only contains some text (no additional tags), since elementsFromPoint can return an empty array if there's no element (e.g. only a text node) to return. This causes a problem where the link-hint for a clickable element containing such a shadow root could be mistakenly hidden.

In this case, we can't produce an element to represent the content of the shadow root (because it contains no elements!), so we should just return the shadow root itself.

Should fix #4620.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Text as direct child of shadow-root prevents link hint
1 participant