-
-
Notifications
You must be signed in to change notification settings - Fork 225
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
rc-trigger
Does not work in a Shadow DOM
#301
Comments
@Jaggler3 your Sandbox is working for me; maybe the React version was < 17? |
Thank you for taking a look @davidenke In case this is a browser issue, I am on Brave (chromium) https://github.com/react-component/trigger/blob/master/src/index.tsx#L37 I just tried to downgrade the CodeSandbox to 16.14 and the dropdown won't open at all, that may be related to the issue you linked? |
@Jaggler3, yes, both version work for me on latest Chrome on macOS 12.4. After downgrading to React 16 I was able to reproduce the behaviour you described, so I shared my findings about the changes in the react event system :) Nevertheless |
That makes sense. In my case I encountered the issue because it was injecting CSS into the |
Can you help to try the new package |
To be specific, mouseEnter / mouseLeave won’t work in React 16 Shadow DOM and that's what Upgrade to React 17 work but it might break some styled-components used from other UI libraries so I added some overrides to overcome the consequences too
|
Found this issue using the Ant Design package and traced it down to this dependency.
Reference: ant-design/ant-design#35897
Reproduce: https://codesandbox.io/s/ant-design-web-component-issues-lx7d2v?file=/index.js
Workaround is to pass this prop:
documentElement
is retrieved usinggetRootNode()
of the trigger element and also needs to addcreateElement
to it becauserc-trigger
thinks it is a document object.The text was updated successfully, but these errors were encountered: