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

contenteditable within Shadow DOM does not fire 'onSelect' #32

Closed
GuruM opened this issue Jun 2, 2017 · 1 comment
Closed

contenteditable within Shadow DOM does not fire 'onSelect' #32

GuruM opened this issue Jun 2, 2017 · 1 comment

Comments

@GuruM
Copy link

GuruM commented Jun 2, 2017

It seems that a contenteditable <div> within ReactShadow does not fire an onSelect event. This event is usually fired when you click anywhere within a contenteditable.

I'm actually not certain whether this is a problem with the Shadow DOM spec or a problem with react-shadow, but I thought there might be some insight here into the problem. I've made a minimal codepen that illustrates the issue: https://codepen.io/anon/pen/JJPBaL?editors=1011

If you click within the red area (outside the Shadow DOM), you'll see a log in the console, but if you click within the blue area (inside the Shadow DOM), you don't see anything written to the console.

@Wildhoney
Copy link
Owner

As onSelect for contentEditable fields is non-native, I'd assume it's an issue buried somewhere in react-dom's SelectEventPlugin. Without stepping through that code I'm not sure. However I'd presume it's attaching the event to a node above the shadow boundary, which is blocked during its bubble phase by the boundary.

What is the purpose of having an onSelect event on the contentEditable field? As onClick seems to achieve the same thing. I must be missing something.

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