Clicking on the element in the shadow-dom (in this case the imageEl) does not ultimately trigger a navigate event.
The issue stems from the fact that the matchesAncestor function (src) only searches ancestors up to the boundary of the shadow-root—and does not look for matching elements in the light dom.
Steps to Reproduce
Create a web-component that has some clickable content
Make that web-component a child of an anchor with href attribute
Click on the web-component
Observe that no "navigate" element is dispatched
Expected Behavior
Clicking on the content inside of the web-component should still trigger a navigate event if it is a child of an anchor—even if the anchor is a light-dom ancestor.
Prerequisites
Version (i.e. v2.x.x)
1.0.1
Node.js version (i.e. 18.x, or N/A)
N/A
Operating system
N/A
Operating system version (i.e. 20.04, 11.3, 10, or N/A)
N/A
Description
Given an anchor with a child web-component, like so:
where the web-component has some clickable content, e.g.
Clicking on the element in the shadow-dom (in this case the
imageEl
) does not ultimately trigger anavigate
event.The issue stems from the fact that the
matchesAncestor
function (src) only searches ancestors up to the boundary of the shadow-root—and does not look for matching elements in the light dom.Steps to Reproduce
Expected Behavior
Clicking on the content inside of the web-component should still trigger a
navigate
event if it is a child of an anchor—even if the anchor is a light-dom ancestor.