Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix an issue where pageIndex becomes invalid when data is changed (removed) and autoResetPageIndex is false. #5031

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

hamidvirani
Copy link

This fixes issue #4994

The pageIndex now gets set to correct value, if invalid, when autoResetPageIndex is false and data changes

@KevinVandy
Copy link
Member

I like this! I have to get around it with an useEffect in my tanstack table code bases like this:

https://github.com/KevinVandy/mantine-react-table/blob/433b24f761e10e4268039763479e8b415286334f/packages/mantine-react-table/src/hooks/useMRT_Effects.ts#L50

Will look into merging this fix

@hamidvirani
Copy link
Author

Hi,

Do you think this PR can be merged?

@p-viral
Copy link

p-viral commented Jan 11, 2024

Any news on when this will be merged?

I am hoping to get this working to release app to production. This is a blocker if pagination does not reset when the last row is deleted in the last page and the table does not reset to the previous page.

Please help.

@KevinVandy
Copy link
Member

Any news on when this will be merged?

I am hoping to get this working to release app to production. This is a blocker if pagination does not reset when the last row is deleted in the last page and the table does not reset to the previous page.

Please help.

You can always just do this with your own code. Any fix here would just be a quality of life update.

@hamidvirani
Copy link
Author

@KevinVandy I have resolved the conflicts if we want to merge this PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants