Open
Description
TanStack Table version
v8.21.3
Framework/Library version
React v18.2.0
Describe the bug and the steps to reproduce it
When the table is initialized with a pagination state, and the getGroupedRowModel
is set, the pageIndex is immediately reset to 0.
Here is a demo https://codesandbox.io/p/devbox/github/tanstack/table/tree/main/examples/react/pagination?embed=1&theme=light
It is taken directly from the pagination example, with 2 changes:
- Updating the initial pageIndex to (for example) 5
- Add
getGroupedRowModel: getGroupedRowModel(),
to the table options
(Note: this also occurs when a grouping
state is passed, but having a grouping
state is not required to see the issue)
Your Minimal, Reproducible Example - (Sandbox Highly Recommended)
Screenshots or Videos (Optional)
No response
Do you intend to try to help solve this bug with your own PR?
Yes, I am also opening a PR that solves the problem along side this issue
Terms & Code of Conduct
- I agree to follow this project's Code of Conduct
- I understand that if my bug cannot be reliable reproduced in a debuggable environment, it will probably not be fixed and this issue may even be closed.
Metadata
Metadata
Assignees
Labels
No labels