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] Fire change event when the state changes, not when firing the prop change callback in control mode #3388

Merged
merged 3 commits into from
Dec 15, 2021

Conversation

flaviendelangle
Copy link
Member

@flaviendelangle flaviendelangle commented Dec 10, 2021

Fixes #3328

New behavior

When we try to update a controlled sub-state, we fire the onXXX prop (like today) but we do no longer fire the GridEvents.xxxChange

The GridEvents.xxxChange is now fired when the state changes.
So that internal listeners of this event can take for granted that the state did change.

@flaviendelangle flaviendelangle self-assigned this Dec 10, 2021
@flaviendelangle flaviendelangle changed the title [DataGrid] Fire change event when the state changes, not when the prop changes in control mode [DataGrid] Fire change event when the state changes, not when firing the prop change callback in control mode Dec 10, 2021
@flaviendelangle flaviendelangle added component: data grid This is the name of the generic UI component, not the React module! priority: important This change can make a difference labels Dec 13, 2021
Copy link
Member

@m4theushw m4theushw left a comment

Choose a reason for hiding this comment

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

It would be nice to add a test case covering the bug in #3328

@flaviendelangle
Copy link
Member Author

I'll add a test before merging 👍

@flaviendelangle flaviendelangle merged commit e4eb267 into mui:master Dec 15, 2021
@flaviendelangle flaviendelangle deleted the controlled-event branch December 15, 2021 08:43
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! priority: important This change can make a difference
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[DataGrid] Can't go to next page after changing pageSize
2 participants