Skip to content
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

[data grid] Filter panel - Props doesn't passed to selects #16721

Open
YosefSchwartz opened this issue Feb 24, 2025 · 5 comments
Open

[data grid] Filter panel - Props doesn't passed to selects #16721

YosefSchwartz opened this issue Feb 24, 2025 · 5 comments
Labels
bug 🐛 Something doesn't work component: data grid This is the name of the generic UI component, not the React module! feature: Filtering Related to the data grid Filtering feature

Comments

@YosefSchwartz
Copy link

YosefSchwartz commented Feb 24, 2025

Steps to reproduce

Steps:

  1. Open this link to live example: Link to minimal example
  2. Click on filters button

Current behavior

The filter item render the default drop-down icon (ArrowDropDownIcon)

Expected behavior

The filter item should be rendering the drop-down icon that passed via the props (ArrowDropDownCircleIcon)

Context

Since operatorInputProps is mentioned as "Props passed to the logic operator input component" in operatorInputProps docs, I expected that all valid <Select/> props should be passed to the input component (Select props), like it works with variant and size.

I tried to change the drop-down icon, but it doesn't.

Thanks!

Your environment

npx @mui/envinfo
  Don't forget to mention which browser you used.
  Output from `npx @mui/envinfo` goes here.

Search keywords: select filter icon

@YosefSchwartz YosefSchwartz added bug 🐛 Something doesn't work status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Feb 24, 2025
@github-actions github-actions bot added the component: data grid This is the name of the generic UI component, not the React module! label Feb 24, 2025
@michelengelen
Copy link
Member

This will get fixed in the new major release with #16394 ... I am not sure if we can support this with a workaround atm. The problem is that the props are being spread on top of a FormControl component and not the actual Select component.

I'll add this to the board as it is clearly a bug we should fix for the current stable version! 👍🏼

@michelengelen michelengelen added feature: Filtering Related to the data grid Filtering feature and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Feb 25, 2025
@github-project-automation github-project-automation bot moved this to 🆕 Needs refinement in MUI X Data Grid Feb 25, 2025
@YosefSchwartz
Copy link
Author

Thanks!
Just added that it occurred also in the columns select.

@romgrk
Copy link
Contributor

romgrk commented Feb 25, 2025

For now I would recommend implementing the baseSelect slot yourself if you need to customize it:

function CustomSelect(props) { ... }

<DataGrid
  slots={{ baseSelect: CustomSelect }}
/>

@YosefSchwartz
Copy link
Author

YosefSchwartz commented Feb 25, 2025

For now I would recommend implementing the baseSelect slot yourself if you need to customize it:

function CustomSelect(props) { ... }

<DataGrid
slots={{ baseSelect: CustomSelect }}
/>

@romgrk
I tried it now, but it's not working.
Did you succeed?

-------- EDIT -----

I tried to pass through the slotProps the icon to the baseSelect, and it didn't work.
Now I tried to pass the whole components with the new icon and it works!

Thanks!

@romgrk
Copy link
Contributor

romgrk commented Feb 26, 2025

I don't think this is a bug, we can't be both design-system agnostic and allow passing any material-ui prop to our base components. I would recommend directing users to the solution above for customization.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something doesn't work component: data grid This is the name of the generic UI component, not the React module! feature: Filtering Related to the data grid Filtering feature
Projects
Status: 🆕 Needs refinement
Development

No branches or pull requests

3 participants