-
Notifications
You must be signed in to change notification settings - Fork 46.9k
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
Proof of concept: Shadow DOM support #1877
Conversation
👍 |
Can you close #1167 if that's now out of date & not necessary? |
I'd be interested in this pull request being merged, if it's in the cards. |
We'll have a different way of enabling custom elements that doesn't expose the internal class. This needs to take into account detached containers. Surprised we don't have a test for that. |
Is there a branch for that or is it just in the planning stages? |
Hey guys, any news on that one ? The changes on ReactDOMComponent.js really makes the event system works within shadow DOM and it would be very cool to be able to mix React components and webcomponents using the shadow DOM. |
👍 |
Any plans of implementing this? There are many use cases where this can be really helpful, expecially for building browser extentions where shadow dom is used to ecapsulate the CSS and the DOM from the rest of the page |
Awesome!!! 👍 |
Hi there, |
The right solution is to use |
var doc = container.nodeType === ELEMENT_NODE_TYPE ? container.ownerDocument : container; I've cursed these 3 lines a thousand times when writing the Maple library for React. In the end I took the approach of sending events to each element in the |
+1 on the Shadow DOM aware suggestion! |
* Remove `shadowRoot` * Reason: React does not bind events to the correct container inside a webcomponent, so events would not bubble * See: facebook/react#1877 * Note: Lucuma 0.5.0 will remove support for shadowRoot!
Why not merge? |
We can already render into shadow roots, this diff lets us listen to events inside shadow DOM.