composedPath
is incorrect for composed bubbling events originating from HTMLAnchorElement
#709
Labels
bug
Something isn't working
Describe the bug
There's an issue where
Event.composedPath
will be constructed incorrectly ifevent.target
isHTMLAnchorElement
withhref
attribute being set.To Reproduce
Steps to reproduce the behavior:
href
attribute set to a valid domain, e.g.https://example.com
and it attach tobody
.click
.click
event on this element. Event should have bothbubbles
andcomposed
set totrue
.event.composedPath()
insideclick
event handler.Expected behavior
Composed path should be the following array:
[HTMLAnchorElement, document.body, document.documentElement, document, window]
.Additional context
Looks like
composedPath
checkseventTarget.host
to detectIShadowRoot
boundary. UnfortunatelyHTMLAnchorElement
also hashost
property which breakswhile
loop through parent nodes of the event target.happy-dom/packages/happy-dom/src/event/Event.ts
Lines 71 to 78 in 62085eb
The text was updated successfully, but these errors were encountered: