-
-
Notifications
You must be signed in to change notification settings - Fork 1.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
After applying shadow root, some components' style lost #5030
Comments
Hey @Bwatermelon |
Hi @cherniavskii , I just update the codesandbox. please have a look. Thanks. |
Hey @Bwatermelon <DataGrid
componentsProps={{
columnsPanel: { container: shadowRootElement },
filterPanel: { container: shadowRootElement },
panel: { container: shadowRootElement },
preferencesPanel: { container: shadowRootElement },
basePopper: { container: shadowRootElement },
baseTooltip: { PopperProps: { container: shadowRootElement } },
baseSelect: { MenuProps: { container: shadowRootElement } }
}}
/>
const theme = createTheme({
components: {
MuiMenu: {
defaultProps: {
container: shadowRootElement
}
},
MuiModal: {
defaultProps: {
container: shadowRootElement
}
}
}
}); Here's a working demo: https://codesandbox.io/s/amazing-noyce-p0ocvw?file=/src/index.tsx Can you share more details about your use case? What problems does shadow DOM solve for you? |
Hi @cherniavskii, Thanks very much for the help. Why we apply the shadow DOM: Sorry to disturb you again and again. There is two bugs in the demo:
When I check the doc, I found one typo that you could correct: https://mui.com/x/react-data-grid/filtering/ Thanks very much, have a good day. |
Hey @Bwatermelon const theme = createTheme({
components: {
MuiPopover: {
defaultProps: {
container: shadowRootElement
}
},
MuiPopper: {
defaultProps: {
container: shadowRootElement
}
}
}
}); This solves all the issues regarding broken styles, as all components are now mounted inside shadow root element. |
This one is tricky, looks like focus management is different in shadow DOM. |
@cherniavskii thanks very much, change the container for these two |
Order ID 💳
#38795
Duplicates
Latest version
The problem in depth 🔍
After I attached the shadow root, some components' style are lost and the display position are incorrect. For example, the menu from column header looks like behind the grid content, the drop down option list does not locate just below the cell etc.
I just created this example: https://codesandbox.io/s/ecstatic-fire-8wkqzw?file=/src/index.tsx
Thanks for the help.
Here are some examples:
Your environment 🌎
System:
OS: macOS 12.3.1
Binaries:
Node: 16.13.1 - /usr/local/bin/node
Yarn: 1.22.18 - /usr/local/bin/yarn
npm: 8.1.2 - /usr/local/bin/npm
Browsers:
Chrome: 101.0.4951.64
Edge: Not Found
Firefox: Not Found
Safari: 15.4
npmPackages:
@emotion/react: ^11.9.0 => 11.9.0
@emotion/styled: ^11.8.1 => 11.8.1
@mui/base: 5.0.0-alpha.82
@mui/envinfo: ^2.0.6 => 2.0.6
@mui/icons-material: ^5.8.0 => 5.8.0
@mui/lab: ^5.0.0-alpha.83 => 5.0.0-alpha.83
@mui/material: ^5.8.1 => 5.8.1
@mui/private-classnames: ^5.7.0 => 5.7.0
@mui/private-theming: 5.8.0
@mui/styled-engine: 5.8.0
@mui/system: ^5.8.1 => 5.8.1
@mui/types: 7.1.3
@mui/utils: 5.8.0
@mui/x-data-grid: ^5.11.1 => 5.11.1
@mui/x-data-grid-pro: ^5.11.1 => 5.11.1
@mui/x-date-pickers: ^5.0.0-alpha.2 => 5.0.0-alpha.2
@mui/x-date-pickers-pro: ^5.0.0-alpha.2 => 5.0.0-alpha.2
@mui/x-license-pro: ^5.10.0 => 5.10.0
@types/react: ^18.0.9 => 18.0.9
react: ^18.1.0 => 18.1.0
react-dom: ^18.1.0 => 18.1.0
typescript: ^4.5.5 => 4.5.5
The text was updated successfully, but these errors were encountered: