Skip to content

Events not registered inside shadow dom #10422

Closed
@LukasBombach

Description

@LukasBombach

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

What is the current behavior?
When you render a react component inside a shadow DOM, events will not be dispatched in react. I.e. you do something like this:

<div onClick={() => alert('I have been clicked')}>foo bar</div>

but nothing happens. Someone investigated this already, got to the bottom of it and wrote a work around: https://stackoverflow.com/questions/37866237/click-event-not-firing-when-react-component-in-a-shadow-dom

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem.

Following the official docs (https://facebook.github.io/react/docs/web-components.html ):

https://jsfiddle.net/84v837e9/187/

What is the expected behavior?

Events should be dispatched even when the react app is rendered in a shadow dom

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

All browsers, tested with react 15.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions