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

[DataGrid] Fix QuickFilter debounce overriding input value #16856

Merged
merged 3 commits into from
Mar 7, 2025

Conversation

KenanYusuf
Copy link
Member

@KenanYusuf KenanYusuf commented Mar 7, 2025

This quick filter test started failing occasionally since merging #16814

I missed a bit of logic when refactoring the GridToolbarQuickFilter to use the new QuickFilter that sets prevQuickFilterValuesRef.current to the new value.

@KenanYusuf KenanYusuf added bug 🐛 Something doesn't work component: data grid This is the name of the generic UI component, not the React module! regression A bug, but worse and removed bug 🐛 Something doesn't work labels Mar 7, 2025
@mui-bot
Copy link

mui-bot commented Mar 7, 2025

Deploy preview: https://deploy-preview-16856--material-ui-x.netlify.app/

Generated by 🚫 dangerJS against c42adc4

@@ -81,7 +81,9 @@ function QuickFilter(props: QuickFilterProps) {
const setQuickFilterValueDebounced = React.useMemo(
() =>
debounce((newValue: string) => {
apiRef.current.setQuickFilterValues(parser(newValue));
const newQuickFilterValues = parser(newValue);
prevQuickFilterValuesRef.current = newQuickFilterValues;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Restores the logic from the original GridToolbarQuickFilter, as seen here in a version of the code before I merged the toolbar update:

prevQuickFilterValuesRef.current = newQuickFilterValues;

@KenanYusuf KenanYusuf marked this pull request as ready for review March 7, 2025 10:46
@KenanYusuf KenanYusuf requested a review from a team March 7, 2025 10:53
@KenanYusuf KenanYusuf merged commit 81ea487 into mui:master Mar 7, 2025
18 checks passed
@KenanYusuf KenanYusuf deleted the fix-quick-filter-test branch March 7, 2025 11:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: data grid This is the name of the generic UI component, not the React module! regression A bug, but worse
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants