jbetancur / react-data-table-component

A responsive table library with built-in sorting, pagination, selection, expandable rows, and customizable styling.
https://react-data-table-component.netlify.app
Apache License 2.0
2.03k stars 409 forks source link

Pagination for large table off by 1 #1205

Open NathanMoes opened 7 months ago

NathanMoes commented 7 months ago

Issue Check list

Describe the bug

A clear and concise description of what the bug is.

With a data table that uses an id to sort that is number::number, when sorting desc the first element (1::1) gets paginated into its own section. This makes all other groupings off by 1. eg section 1:: include 2::1, and 2:: includes 3::1 when each should only include 2:: or 3:: respectively. Table size here is 26*40 (26 main sections, 40 sub elements each)

To Reproduce

Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior

A clear and concise description of what you expected to happen.

Code Sandbox, Screenshots, or Relevant Code

Please include a codesandbox to help expedite troublshooting.

https://codesandbox.io/embed/react-data-table-sandbox-ccyuu

Otherwise, add screenshots and/or complete sample code to help explain your problem.

Versions (please complete the following information)

Additional context

Add any other context about the problem here. Screenshot 2024-01-18 at 8 43 35 AM Screenshot 2024-01-18 at 8 43 56 AM