-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
[BUG] Table pagination example is flawed #5757
Comments
Hi, I noticed the issue with cursor pagination. I'd like to help resolve it. Looking forward to contributing. Thanks!" |
Hey @ElementalWarrior, I've analyzed the issue but need a visual aid to understand it better. Could you provide a video or image? It'll help me grasp the problem more effectively. Thanks! |
Click the link, go to the demo, click forward and back on the pagination. |
This comment was marked as off-topic.
This comment was marked as off-topic.
You didn't actually click the paging back and forth. |
The issue is with the example, not the websites navigation |
In table-material-ui-cursor-pagination Data provider was using the most recent date of any fetched data as an "until" filter instead of paging, which caused both forward & backward to go back in the Github API commit list.
@ElementalWarrior thanks for the clarification. I see the behavior you described. There is indeed a problem with how the example sets up the datagrid. Apparently each subsequent request to the Github API is using an Relevant code: The API's refine/examples/table-material-ui-cursor-pagination/src/rest-data-provider/index.ts Lines 16 to 17 in fedb191
This value is passed to the datagrid using the state variable refine/examples/table-material-ui-cursor-pagination/src/pages/posts/list.tsx Lines 10 to 14 in fedb191
And the value of refine/examples/table-material-ui-cursor-pagination/src/pages/posts/list.tsx Lines 70 to 77 in fedb191
I'm not sure if this customized pagination was intended to be part of this example. For most use-cases, what the component has built-in should serve and custom pagination seems sufficiently documented. I tested commit 97b82a0 which removes the custom code in favor of the component's default implementation. If customization was intended in this example, Github's API allows for a @ElementalWarrior as someone who used this example, do you have thoughts on which you prefer? |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Describe the bug
https://refine.dev/docs/examples/table/mui/cursor-pagination/
Firstly this example only works one direction. The back button just moves forward further.
Secondly, by taking this approach, changing filters or sort breaks the "current page" referenced. The
${pagestart} - ${pageEnd}
count will be inaccurate.I don't have a solution for cursor pagination, but this example is not something people should try to use.
Steps To Reproduce
Expected behavior
previous button in pagination works. And there is an example with the datagrid that works properly.
Packages
refine/examples/table-material-ui-cursor-pagination
Additional Context
No response
The text was updated successfully, but these errors were encountered: