Skip to content

[data grid] Page reset with change of filter model and sort model doesn't let me to reset the page size #20114

@segullshairbutt

Description

@segullshairbutt

Steps to reproduce

Steps:

  1. Open this link to live example: (required)
  2. Change the page size to other than the default one
  3. Apply either a filter or a sort on the column
  4. Change the page to some other page e.g. 1
  5. Now click on the reset button

Current behavior

The page is properly resetting to 0 but the page size isn't properly resetting. The reason is that, as soon as I do setPaginationModel it changes the page size to 10 but when DataGrid internally changes the page on change of filter model or sort model it uses the old pageSize to do so.

Expected behavior

Either I should have the control to disable the page reset when filter model or sort model is changed or it should properly use the controlled pagination model value to only update the page.

Context

We have data grid bound with URL search params and local storage, everything could be saved and restored properly. At the same time we provide the option of full table reset so that it goes to the default state.

But our full table reset is broken due to this glitch that I couldn't update the pagination (pageSize) to default value when any kind of filter or sort is applied.

Your environment

npx @mui/envinfo
  Browser I used: Chrome: 141.0.7390.123
  System:
    OS: macOS 15.6
  Binaries:
    Node: 22.13.0 - ~/.nvm/versions/node/v22.13.0/bin/node
    npm: 10.9.2 - ~/.nvm/versions/node/v22.13.0/bin/npm
    pnpm: Not Found
  Browsers:
    Chrome: 141.0.7390.123
    Edge: Not Found
    Safari: 18.6
  npmPackages:
    @emotion/react: ^11.13.3 => 11.14.0
    @emotion/styled: ^11.14.1 => 11.14.1
    @mui/core-downloads-tracker:  7.3.1
    @mui/icons-material: ^7.3.1 => 7.3.1
    @mui/material: ^7.3.1 => 7.3.1
    @mui/private-theming:  7.3.1
    @mui/styled-engine:  7.3.1
    @mui/system:  7.3.1
    @mui/types:  7.4.5
    @mui/utils:  7.3.1
    @mui/x-data-grid:  8.14.0
    @mui/x-data-grid-pro: ^8.14.0 => 8.14.0
    @mui/x-date-pickers: ^8.11.0 => 8.11.0
    @mui/x-date-pickers-pro: ^8.11.0 => 8.11.0
    @mui/x-internals:  8.14.0
    @mui/x-license:  8.11.0
    @mui/x-telemetry:  8.11.0
    @mui/x-virtualizer:  0.2.3
    @types/react: ^19.1.12 => 19.1.12
    react: ^19.1.1 => 19.1.1
    react-dom: ^19.1.1 => 19.1.1
    typescript: ^5.9.2 => 5.9.2

Search keywords: page reset, page size, filter model, sort model

Order ID: 108470

Metadata

Metadata

Assignees

Labels

feature: PaginationRelated to the data grid Pagination featurefeature: State managementRelated to the data grid State management featurescope: data gridChanges related to the data grid.support: pro standardSupport request from a Pro standard plan user. https://mui.com/legal/technical-support-sla.type: bugIt doesn't behave as expected.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions