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

[data grid] Strange behavior when paginationMode is undefined #13330

Closed
1 task done
Janpot opened this issue May 31, 2024 · 1 comment · Fixed by #13349
Closed
1 task done

[data grid] Strange behavior when paginationMode is undefined #13330

Janpot opened this issue May 31, 2024 · 1 comment · Fixed by #13349
Labels
bug 🐛 Something doesn't work component: data grid This is the name of the generic UI component, not the React module! feature: Pagination Related to the data grid Pagination feature

Comments

@Janpot
Copy link
Member

Janpot commented May 31, 2024

Search keywords

paginationMode undefined

Latest version

  • I have tested the latest version

Steps to reproduce

Steps:

  1. Go to https://mui.com/x/react-data-grid/pagination/
  2. Add paginationMode={undefined}
  3. Watch the pagination in the Grid

Current behavior

Screenshot 2024-05-31 at 17 47 42

Expected behavior

Screenshot 2024-05-31 at 17 48 13

Context

At first glance this may seem like an edge-case, but it's actually not so uncommon to run into this when writing a wrapper component for the grid and passing through paginationMode

function MyWrapper(props) {
  const { paginationMode, ...rest } = props;

  // do something based on paginationMode

  return <DataGrid paginationMode={paginationMode} {...rest} />
}

The solution could be simple:

const { paginationMode = 'client', ...rest } = props;

But I guess this should just work.

I think in the past I've seen other properties misbehaving when explicitly set to undefined but I can't recall.

Your environment

npx @mui/envinfo
  Don't forget to mention which browser you used.
  Output from `npx @mui/envinfo` goes here.

Order ID or Support key 💳 (optional)

No response

@Janpot Janpot added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label May 31, 2024
@michelengelen michelengelen added bug 🐛 Something doesn't work component: data grid This is the name of the generic UI component, not the React module! feature: Pagination Related to the data grid Pagination feature labels Jun 3, 2024
@michelengelen michelengelen changed the title [DataGrid] Strange behavior when paginationMode is undefined [data grid] Strange behavior when paginationMode is undefined Jun 3, 2024
@michelengelen michelengelen removed the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Jun 3, 2024
@github-project-automation github-project-automation bot moved this to 🆕 Needs refinement in MUI X Data Grid Jun 3, 2024
@michelengelen michelengelen moved this from 🆕 Needs refinement to 🏗 In progress in MUI X Data Grid Jun 3, 2024
Copy link

github-actions bot commented Jul 4, 2024

⚠️ This issue has been closed. If you have a similar problem but not exactly the same, please open a new issue.
Now, if you have additional information related to this issue or things that could help future readers, feel free to leave a comment.

@Janpot: 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.

@cherniavskii cherniavskii moved this from 🏗 In progress to ✅ Done in MUI X Data Grid Jul 9, 2024
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! feature: Pagination Related to the data grid Pagination feature
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants