table icon indicating copy to clipboard operation
table copied to clipboard

`Infinity` is not supported for pageSize

Open simPod opened this issue 1 year ago • 4 comments

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

  • [X] I agree to follow this project's Code of Conduct
  • [X] 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.

simPod avatar May 16 '24 15:05 simPod

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.

KevinVandy avatar May 16 '24 16:05 KevinVandy

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

simPod avatar May 16 '24 17:05 simPod

How about using Number.MAX_SAFE_INTEGER

beanznotavailable avatar Jul 28 '24 08:07 beanznotavailable

That is not an infinity tho.

simPod avatar Jul 28 '24 10:07 simPod