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] onPageChange shouldn't fire on first render #228

Closed
2 tasks done
oliviertassinari opened this issue Aug 29, 2020 · 0 comments
Closed
2 tasks done

[DataGrid] onPageChange shouldn't fire on first render #228

oliviertassinari opened this issue Aug 29, 2020 · 0 comments
Assignees
Labels
bug 🐛 Something doesn't work component: data grid This is the name of the generic UI component, not the React module!

Comments

@oliviertassinari
Copy link
Member

  • The issue is present in the latest release.
  • I have searched the issues of this repository and believe that this is not a duplicate.

Current Behavior 😯

onPageChange is triggered during the first display of the grid.

Expected Behavior 🤔

onPageChange should only be triggered when the first page changes. Unless the developer is providing value, it should use 1 as the default value, and hence, no even should be fired.

Steps to Reproduce 🕹

Steps:

  1. https://codesandbox.io/s/cranky-fire-9lhto?file=/demo.tsx
  2. Notice the console log

Context 🔦

I have found this surprising behavior when working on the server-side pagination demo.

Your Environment 🌎

Tech Version
Material-UI X v0.1.67
@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 Aug 29, 2020
dtassone added a commit to dtassone/material-ui-x that referenced this issue Sep 14, 2020
@dtassone dtassone self-assigned this Sep 14, 2020
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

No branches or pull requests

2 participants