TanStack / TanStack/table

Manual Pagination doesnt reset PageIndex when Manual Column Filtering. (server-side, v8)

Open
#4,797 4 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
28.4k
Forks
3.6k
Avg merge
1d 14h
Merged PRs (30d)
10

Description

Describe the bug

We have recently moved to use v8 of react-table and have noticed a bug where the pageIndex doesn't reset when we are using manualPagination and manualFiltering. This is when we are making server-side calls to get our data with the information.

In v7 it was the case that we would have our pageIndex reset to 0 when we make a filter change when we had both manualPagination && manualFiltering.

This resulted in the correct Query being made, however with the regression in behaviour in v8 we are seeing incorrect requests.

Your minimal, reproducible example

https://codesandbox.io/p/sandbox/festive-hertz-chekxf

Steps to reproduce
  1. go to page 1000
  2. filter on status complicated
  3. you'll see page 1000/331 - with no data
Expected behavior

As a User when i am on a page I should be reset back to the first page when i filter and expect to see the the contents of the filter on page 1/331

How often does this bug happen?

Every time

Screenshots or Videos

Screenshot 2023-04-05 at 09 34 54
Screenshot 2023-04-05 at 09 35 05

Platform
  • MacOS 13.2.1
  • Chrome 111.0.5563.146
react-table version

V8.8.5

TypeScript version

No response

Additional context

No response

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Run the linked CodeSandbox reproduction with react-table v8.8.5, starting from the manualPagination and manualFiltering behavior when filtering from page 1000. Done means changing the status filter resets pageIndex to 0 and the resulting server-side request displays the filtered data on page 1.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, typescript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.