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
24.49k stars 3.03k forks source link

docs(pagination): rephrase autoResetPageIndex behaviour #5601

Closed Balastrong closed 3 weeks ago

Balastrong commented 3 weeks ago

Hey! I was confused by the autoResetPageIndex explanation since I noticed it wasn't working on a table with manualPagination (which is the expected behavior - all good here).

The docs mention autoResetPageIndex is true by default but I had a look at the code and if I'm not mistaken it is undefined by default.

Here is when the magic happens: https://github.com/TanStack/table/blob/f7e69bc9939d170a1e2fa4112e369814143b8114/packages/table-core/src/features/RowPagination.ts#L226-L230

I rephrased that sentence in the docs removing the mention to "the flag true by default". The behaviour is active by default, but the flag isn't true otherwise manualPagination wouldn't override it in the snippet above.