Skip to content

[data grid] Pagination issue on row population #19281

@sydneyjodon-wk

Description

@sydneyjodon-wk

Steps to reproduce

Steps:

  1. Open this link to live example: https://stackblitz.com/edit/1yfh2vxy?file=src%2FDemo.tsx
  2. Click the populate rows button
  3. See that the rows that are displayed go beyond the page size:

Image

Current behavior

Hello 👋 I'm seeing an issue where if a DataGridPro is initially rendered with no rows and I conditionally turn off pagination for no rows, then when I populate the rows, for some reason the pagination turns on, but doesn't function properly. See in the gif how all 11 rows are still displayed even though the pagination says only 5 should be displayed.

Expected behavior

I would expect to be able to change the pagination prop to true and the pagination to both turn on and function properly to only show the amount of rows the page size specifies.

Context

This is happening because our rows are delayed loading in so at first there's no rows and pagination is off, but then we want to turn pagination on when there are rows.

Any help would be appreciated! Thank you!

Your environment

See code sandbox on latest dependencies: https://stackblitz.com/edit/1yfh2vxy?file=src%2FDemo.tsx

Search keywords: pagination, row, no rows, row count

Order ID: 82849

Metadata

Metadata

Assignees

Labels

scope: data gridChanges related to the data grid.support: premium standardSupport request from a Premium standard plan user. https://mui.com/legal/technical-support-sla.type: regressionA bug, but worse, it used to behave as expected.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions