-
-
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
[DataGrid] Input fields do not honor defined theme
variant
#2944
Comments
Hi, @sebastianfrey thanks for raising this. It is indeed a problem this is the problematic line -> https://github.com/mui-org/material-ui-x/blob/next/packages/grid/_modules_/grid/components/panel/filterPanel/GridFilterInputValue.tsx#L101 We need to rethink how we style some of the core components. One possibility is to have a grid-specific theme or just grab the theme and spread the props if there are any on to each core component we use? |
@DanailH thanks for looking into it. This line in the |
@sebastianfrey yes there are more than one cases where this problem will appear. We are discussing it internally how to handle the fix and what would be the best and most scalable approach. |
MUI Core has the same problem. Take as example the As we discussed yesterday, here are the options I could think of:
|
I would personally advocate for 4. or using default props when possible. For instance:
|
After a team discussion, we decided to proceed with option 4. For now, we will include slots for form elements. The naming convention we discussed using is |
Sounds this issue has been solved by @DanailH in #3490 The Text fields are customizable with componentsProps={{
baseTextField: {
variant: "outlined",
margin: "dense",
size: "small"
}
}} https://codesandbox.io/s/sleepy-dubinsky-5iuf1o Can we close this issue, or do we keep it open until we add a slot to each component from |
Closed by #3490 |
Duplicates
Latest version
Current behavior 😯
When the
DataGrid
is a child ofThemeProvider
with a custom theme, which overrides and sets the defaultMuiTextField
variant tooutlined
, than the defined variant is not honored by theDataGrid
s input fields.Expected behavior 🤔
Input fields rendered in the context of the
DataGrid
should honor theme overrides.Steps to reproduce 🕹
Steps:
outlined
outlined
variant.Context 🔦
I want to achieve a consistent look and feel in my application for my users.
Your environment 🌎
`npx @mui/envinfo`
Order ID 💳 (optional)
22075
The text was updated successfully, but these errors were encountered: