-
-
Notifications
You must be signed in to change notification settings - Fork 707
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
Pagination component does not keep state when navigating away from it #3868
Comments
there needs to be something like what SearchBlock is using: https://github.com/plone/volto/blob/master/src/components/manage/Blocks/Search/hocs/withSearch.jsx#L200 This is a complicated problem space: it's easy to overdo it and end up with performance issues, or long/ugly URLs |
@tiberiuichim What kind of performance issues are you thinking about? You mean from clients trying to change the batch size to load too many items at once, or search engines following the links to index all of the pages without rate limiting? |
We've been hit by search engines trying all kind of fancy request
parameters in classic Plone UI, so this could be an issue here too
|
@davisagli I think I used the wrong term when I wrote "performance". I was mainly thinking of how to stash all the listing block states in URLs, considering that there can be multiple listing blocks on a page. |
@tiberiuichim I see. Yeah, that's tricky. To keep things simpler, could we decide to only support this for the first listing block on a page? Or maybe we could stash the pagination state in sessionStorage keyed by block uid and not try to sync it with the URL. |
We could use the persistentReducers to keep the state synced to localStorage. I wish, though, that the current implementation of our persistentReducers would use session storage instead of local storage. |
In Plone batches the developer can pass an additional parameter setting the request variable name this way you can have several batches in one page one being |
Describe the bug
When the user navigates away from a listing that has pagination, the listing block doesn't keep the state on which was rendered, and if the user goes back to the listing block, the pagination state is recalculated and rendered again from the 1st page.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
After going back I expect to be in the same page that I was before I left the page
Additional context
There is no querystring like ?page=1, or b_start=20 or something like that that could help on getting the actual page the user was on.
The text was updated successfully, but these errors were encountered: