React: Events don't work when creating a portal to an element in shadow DOM

Created on 3 Jun 2018  路  3Comments  路  Source: facebook/react

Do you want to request a feature or report a bug?
Bug

What is the current behavior?
No events are emitted through the synthetic event system when a portal is created to an element within shadow DOM.

Reproduction
See https://jsfiddle.net/Luktwrdm/453/

What is the expected behavior?
createPortal should detect that the element is inside shadow DOM.

Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React?
16.4.0
Probably not


This is not a major bug, but a source for some confusion. React should however either support it or add a warning in development.

Most helpful comment

I believe this is the same root issue as https://github.com/facebook/react/issues/9242

All 3 comments

Wow, nice catch.
Seems we need to re-target the event.

Hopefully i can help, i wanna try learn and contribute on react. :)
I just look around react core code though.

I believe this is the same root issue as https://github.com/facebook/react/issues/9242

This is fixed in React 17 RC.
https://jsfiddle.net/6g3muvfy/

Was this page helpful?
0 / 5 - 0 ratings