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

Refactor pagination #3

Open
maggie44 opened this issue Feb 18, 2021 · 5 comments
Open

Refactor pagination #3

maggie44 opened this issue Feb 18, 2021 · 5 comments
Labels

Comments

@maggie44
Copy link
Contributor

When you have loaded all the results, the Load More button greys out. But when you have filtered results, it doesn't know you have reached the end of the results because it is still using totalCount from GraphQL. Related to issue: #2

@maggie44 maggie44 added the bug Something isn't working label Feb 18, 2021
@maggie44 maggie44 changed the title Load more button not greying out after filter change Load more button not greying Feb 21, 2021
@maggie44
Copy link
Contributor Author

Also not greying out when getting to bottom of list. May be because it includes the count for unpublished content.

@maggie44
Copy link
Contributor Author

It was to do with drafts. This will likely be resolved along with #2.

@maggie44
Copy link
Contributor Author

Now looking to change the ‘load more’ button to a next/previous page feature (pagination). Hopefully that will resolve the issue with needing to count all the entries through GraphQL and the issue of the load more button not working very well.

@maggie44 maggie44 changed the title Load more button not greying Add pagination Apr 16, 2021
@maggie44 maggie44 removed the bug Something isn't working label May 1, 2021
@maggie44
Copy link
Contributor Author

The Load More button never really worked well, because of the Strapi issues counting results in GraphQL. I’m thinking best to change this to pagination. If need be, could query all the results to get the total numbers. This isn’t ideal resources wise, but it is always going to be a pretty small database, and as long as we are not pulling all the images and only the text data it shouldn’t make much difference.

@maggie44
Copy link
Contributor Author

maggie44 commented Jun 6, 2021

Implemented infinite scroll. Ideally need to wait for Strapi v4 for better GraphQL support to be able to allow loading of next set of results rather than reload of them all on each scroll. Will look to refactor at that stage.

@maggie44 maggie44 changed the title Add pagination Refactor pagination Jun 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant