-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
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
[Modal] Breaking when modal container is shadowRoot and enable scroll lock #44726
Comments
@VietNguyenQuoc Could you provide a repro in CodeSandbox/Stackblitz? |
Hi @mj12albert, I updated the description, please help to check. Thanks. |
@VietNguyenQuoc See this doc on setting up Material UI for shadow DOM: https://mui.com/material-ui/customization/shadow-dom/#how-to-use-the-shadow-dom-with-material-ui Step 2 in particular is about the Modal const theme = createTheme({
components: {
MuiModal: {
defaultProps: {
container: shadowRootElement,
},
},
},
}); Here's a working sandbox: https://codesandbox.io/p/sandbox/cool-allen-h8j7pm?file=%2Findex.tsx%3A1%2C1 |
Yes I know it's working if we attach the modal to an HTML element. But should it be also working when attach to a shadow root ? @mj12albert |
Looking at the code, it seems Does it affect your use-case by appending an element into the shadow root first? |
Steps to reproduce
Steps:
Current behavior
When trying to render the Modal as the direct child of a shadow root, it throws errors and breaks the app.
Disable the scroll lock will get away with that but I don't think it's the proper way to resolve this issue.
Expected behavior
Should be able to render the Modal as the direct child of shadow root.
Context
No response
Your environment
npx @mui/envinfo
Search keywords: Modal,ShadowRoot
The text was updated successfully, but these errors were encountered: