TanStack / table

🤖 Headless UI for building powerful tables & datagrids for TS/JS - React-Table, Vue-Table, Solid-Table, Svelte-Table
https://tanstack.com/table
MIT License
25.01k stars 3.07k forks source link

`Infinity` is not supported for pageSize #5559

Open simPod opened 4 months ago

simPod commented 4 months ago

TanStack Table version

8.17.3

Framework/Library version

React 18

Describe the bug and the steps to reproduce it

{[10, 20, 30, 40, 50, Infinity].map(pageSize => (
            <option key={pageSize} value={pageSize}>
              Show {pageSize}
            </option>
          ))}

selecting the Infinity causes some infinite loop and crashes the tab.

Your Minimal, Reproducible Example - (Sandbox Highly Recommended)

https://codesandbox.io/p/devbox/cool-bose-tj55js?file=%2Fsrc%2Fmain.tsx%3A206%2C1-207%2C1

Screenshots or Videos (Optional)

No response

Do you intend to try to help solve this bug with your own PR?

None

Terms & Code of Conduct

KevinVandy commented 4 months ago

You can do that if you want. In the onChange handler, just have some logic that sets manual pagination to true to turn off pagination logic in that situation.

simPod commented 4 months ago

I was rather wondering to support that without manual pagination. That said with the native one.

beanznotavailable commented 2 months ago

How about using Number.MAX_SAFE_INTEGER

simPod commented 2 months ago

That is not an infinity tho.