Closed noangel closed 2 years ago
Hey @noangel, thanks for the contribution! People rarely file bug reports with PRs. 😁
Looking up the info on composedPath()
, it looks like it has been supported for a while by most browsers. I see e.composedPath
in the StackOverflow answer, but it looks like it should only be the method.
With this having been supported for some time I was thinking the fix doesn't need to use e.path
at all. It could be this:
const anchors = [...e.composedPath()].filter((el) => el.nodeName === 'A');
instead of
const anchors = [...e.path].filter((el) => el.nodeName === 'A');
What do you think?
@pseudosavant Yes, sure. I think it will be even better to use composedPath() only.
I made the composedPath()
changes on master.
Uncaught TypeError: e.path is undefined getTargetEl http://xxx/player.html:2603 clickLink http://xxx/player.html:2610
"The path property of Event objects is non-standard. The standard equivalent is composedPath, which is a method. But it's new. So you may want to try falling back to that" https://stackoverflow.com/questions/39245488/event-path-is-undefined-running-in-firefox