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

Fails to detect nested text in shadow root of custom component (reddit browse post snippets example) due to event target not matching startNode.parent #2336

Open
melink14 opened this issue Dec 20, 2024 · 0 comments
Labels

Comments

@melink14
Copy link
Owner

melink14 commented Dec 20, 2024

Even after we remove the absolute anchor tag that covers the content, rikaikun doesn't pop anything else due to a check that rp.parentNode === event.target. This seemed to be a check added to tell if the mouse was far from the node but it seems to also trigger in nested cases using shadow root. The event target is always the custom component (on reddit at least)

// Otherwise, we're off in nowhere land and we should go home.
// offset should be 0 or max in this case.
else if (!fake && (!rp || rp.parentNode !== eventTarget)) {
rp = null;
ro = -1;
}

Clearly, we're not off in nowhere land but I'll need to understand this case in order to not add regressions. That said, given the lack of tests we shouldn't be too careful.

One thing that would make it easier to redo this logic is to fix #30 and removing the guesses as to when we're in a failure state.

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

No branches or pull requests

1 participant