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

Feat: hide pagination widget when not needed #4957

Merged
merged 8 commits into from
Nov 8, 2022
Merged

Conversation

presleyp
Copy link
Contributor

@presleyp presleyp commented Nov 8, 2022

Closes #4892 and #4623

We need the pagination widget to show when

  • there are multiple pages of records
  • the user landed on a page beyond the records and needs the ability to navigate back

We don't need the pagination widget when

  • there is only one page of records
  • the number of records hasn't loaded yet (if it shows and then the count is <=1 page, it will disappear again)

This should satisfy all of those! It assumes that we will always include count in our pagination - we used to support count-less pagination with the widget showing previous and next buttons but no page number buttons, but now we rely on the count being available and hide the widget when it's not (because that should mean it's loading, not that it's not going to be available).

@presleyp presleyp requested a review from a team as a code owner November 8, 2022 16:08
@presleyp presleyp requested review from jsjoeio and removed request for a team November 8, 2022 16:08
Copy link
Member

@kylecarbs kylecarbs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Neato

@presleyp presleyp merged commit fa844d0 into main Nov 8, 2022
@presleyp presleyp deleted the hide-pagination/presley branch November 8, 2022 18:29
@github-actions github-actions bot locked and limited conversation to collaborators Nov 8, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

investigate: Is it normal to show pagination where there is nothing to paginate?
3 participants