Skip to content

Click events/HTML injection not working correctly in Shadow DOM? #3937

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

Closed
nlrowe opened this issue Feb 18, 2020 · 1 comment
Closed

Click events/HTML injection not working correctly in Shadow DOM? #3937

nlrowe opened this issue Feb 18, 2020 · 1 comment

Comments

@nlrowe
Copy link

nlrowe commented Feb 18, 2020

I am attempting to use react-select in a custom web component using the shadow DOM but it is not performing as expected.

The menu does not open if I click in the select input box. It does open if I click on the drop down indicator, but it does not add the (what appears to be) screen reader span that I see added when I am using it outside of the shadow DOM. I suspect that it may not be working as intended even if it does pop the menu.

It is also not showing search text properly in the select. You can see clipped text in a very small space at the beginning of the input.

Please find repro here: https://codesandbox.io/s/admiring-northcutt-x99vn

@nlrowe
Copy link
Author

nlrowe commented Mar 4, 2020

After further debugging, it seems the issues lied in the react-shadow-dom-retarget-events dependency. A very similar issue has been filed against the library: spring-media/react-shadow-dom-retarget-events#13.

Doing some more digging around I was able to find facebook/react#9242 on the react repository. I implemented the suggested 'fix' from this comment facebook/react#9242 (comment). It is not really ideal, but it works in the absence of anyone making react events first class citizens for shadow DOM use.

@nlrowe nlrowe closed this as completed Mar 4, 2020
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

1 participant