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

Document React/Helix compatibility issues #74

Open
TheNando opened this issue Mar 22, 2019 · 1 comment
Open

Document React/Helix compatibility issues #74

TheNando opened this issue Mar 22, 2019 · 1 comment

Comments

@TheNando
Copy link

I just learned a very important bit of info that could have saved us countless hours of troubleshooting React/Helix compatibility. This is very useful info that would be helpful to have documented in this project somewhere.

React's synthetic events work via single event listener on the document, which means that you can’t stop propagation/event bubbling of a React synthetic event to a Helix web component via the normal method (event.stopPropagation). The bubbling will only be cancelled for any React synthetic events in the chain.

Instead, you have to use event.nativeEvent.stopImmediatePropagation() from within the synthetic event handler, since synthetic event is technically attached to the document, which is always at the end of the event chain.

@CITguy
Copy link
Contributor

CITguy commented Mar 22, 2019

FYI: facebook/react#12786

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

2 participants