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 onPageChange firing too often #838

Merged
merged 8 commits into from
Jan 13, 2021
Merged

Conversation

dtassone
Copy link
Member

@dtassone dtassone commented Jan 11, 2021

Fix #816, onPageChange firing multiple times

@oliviertassinari
Copy link
Member

Capture d’écran 2021-01-11 à 17 35 28

@dtassone Regarding the format of the pull request, I would recommend the following:

Capture d’écran 2021-01-11 à 17 37 33

  • We polish the title of the pull request to be usable in the changelog, maybe something like this:
    [DataGrid] Fix onPageChange firing too often

@dtassone dtassone changed the title fix issue 816, onPageChange fired twice instead of once fix #816, onPageChange firing multiple times Jan 11, 2021
@oliviertassinari oliviertassinari changed the title fix #816, onPageChange firing multiple times [DataGrid] Fix onPageChange firing too often Jan 11, 2021
@oliviertassinari oliviertassinari added bug 🐛 Something doesn't work component: data grid This is the name of the generic UI component, not the React module! labels Jan 11, 2021
Copy link
Member

@oliviertassinari oliviertassinari left a comment

Choose a reason for hiding this comment

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

I have commented on my understanding of how it should behave. The mental model I have always seen for the change event is: "does something try to change the current state?". For instance, when doing server-side rendering, the default page is already 1, I don't see why it should fire.

@dtassone dtassone merged commit b1397e8 into mui:master Jan 13, 2021
@oliviertassinari oliviertassinari changed the title [DataGrid] Fix onPageChange firing too often [DataGrid] Fix onPageChange firing too often Jan 16, 2021
dtassone added a commit to dtassone/material-ui-x that referenced this pull request Jan 19, 2021
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!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[DataGrid] Events firing multiple times and also while table initially renders
3 participants