-
-
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
[data grid] Autocomplete within filters not working as expected #16065
Comments
Thanks for opening an issue @nicolasfripp ... this is due to the fact that we are rendering the forms via a mapping and every state change rerenders this. mui-x/packages/x-data-grid/src/components/panel/filterPanel/GridFilterPanel.tsx Lines 257 to 272 in 0f66a53
I know that @KenanYusuf is working on a new UI for the panels, so he probably is currently the best to talk to bout this. The main problem is that the filters are of a flexible amount and there is no easy way to memoize them. For now I'll add this to the board and see what the team has to say about this. 👍🏼 |
We just discussed this in the team and @cherniavskii did point out that you need to make the columns array static for this to work, otherwise the He did also create a quick Demo based on your implementation: here. In this case moving the So regarding this I will close the issue as it was implementation specific. |
This issue has been closed. If you have a similar problem but not exactly the same, please open a new issue. Note @nicolasfripp How did we do? Your experience with our support team matters to us. If you have a moment, please share your thoughts in this short Support Satisfaction survey. |
@michelengelen @cherniavskii Thanks for the response! |
@michelengelen @cherniavskii , Here you have the same example but using a select instead: https://codesandbox.io/p/sandbox/5p35km Screen.Recording.2025-01-06.at.14.46.34.mov |
Can you share more details? Anyway, you can extract
I believe that's because Let me know if this works for you. |
@cherniavskii Thanks for your help! I was able to make it work. Memoizing the InputComponent element was the key! |
Steps to reproduce
Steps:
Screen.Recording.2025-01-02.at.13.07.31.mov
Current behavior
The Autocomplete is re-drawn
Expected behavior
I hope that if the Datagrid component is re-rendered, the autocomplete won't be re-drawn (like the Select component).
Context
Im updating some states after applying some filter, which causes this weird behaviour on the Autocomplete. It is only happening in that component, if I use a Select, that does not happen
Your environment
No response
Search keywords: Autocomplete DataGrid DataGridPro filters
The text was updated successfully, but these errors were encountered: