Skip to content
This repository has been archived by the owner on Aug 2, 2024. It is now read-only.

Should event.currentTarget be set to the right element before dispatching? #24

Open
prvnsmpth opened this issue Dec 25, 2019 · 2 comments

Comments

@prvnsmpth
Copy link

In the current implementation, the event that is passed to dispatchEvent has event.currentTarget set to the shadow root. This might break event handling in certain scenarios.

Does it make sense to set the currentTarget before invoking the react event handler?

@prvnsmpth
Copy link
Author

I just realized that event.currentTarget is read-only and cannot be set. Is there any other way we can make sure the react event handler sees the right currentTarget (instead of seeing the shadow root)?

@TiagoRechau
Copy link

You can use event.composedPath()[0], but I also found this issue a bit annoying

svicalifornia added a commit to appjudo/react-shadow-dom-retarget-events that referenced this issue Jun 22, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants