Skip to content

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

@melink14

Description

@melink14

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions