-
Notifications
You must be signed in to change notification settings - Fork 178
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
function inShadow throws error when shadowRoot is undefined #462
Comments
is it possible to create a PR to change the logic as below? export function inShadow(ele: Node) { const root = getRoot(ele); return ShadowRoot ? root instanceof ShadowRoot : root !== ele?.ownerDocument; } |
mazengh
referenced
this issue
Oct 24, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I am using latest antd library version 5.8.6 which is dependent on rc-util. There is an edge case where shadowRoot is undefined. When inShadow function is called, the whole page breaks throwing the error below.
VM107071:1 Uncaught TypeError: Right-hand side of 'instanceof' is not an object
It used to work when function returned
return getRoot(ele) !== ele?.ownerDocument;
Version: rc-util: 5.37.0
The text was updated successfully, but these errors were encountered: