Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handler gets attached twice if name already exists in DOM #26

Open
ChristophP opened this issue Aug 9, 2017 · 1 comment
Open

Handler gets attached twice if name already exists in DOM #26

ChristophP opened this issue Aug 9, 2017 · 1 comment

Comments

@ChristophP
Copy link
Owner

ChristophP commented Aug 9, 2017

If you have a react property called onClick and use it on the web-react-component the handler will fire twice. Once for the native DOM and once for the web react component.

Example (logs twice when clicked):

<some-button onClick="console.log('Hello')"></some-button>

This is not an issue when attaching the handler with addEventListener though, because the DOM event would be click while the web react component event would be onClick

@ChristophP
Copy link
Owner Author

We should check the events .composed property to determine if it bubbles outside of the DOM. If not we should redispatch the event, if not just use the event which bubbles up into the light DOM.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant