Skip to content

fix: disable pagination nav buttons correctly #10561

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

Merged
merged 5 commits into from
Nov 7, 2023
Merged

Conversation

Parkreiner
Copy link
Member

@Parkreiner Parkreiner commented Nov 7, 2023

Stopgap solution for #10452 and #10549

Basically, after looking at the pagination code, there are a few things I think should be updated (especially to address navigation URL edge cases), but there's enough of them that the scope is veering on becoming a feature

I don't want that to block the "easy fix", which is just updating the buttons to be disabled properly

Changes made

All changes were made to PaginationWidgetBase

  • Update the logic for the previous button so that it's disabled if on page 1 (or earlier, if the URL somehow gets malformed)
  • Update the logic for the next button so that it's disabled on the last page or later (this isn't as fool-proof, because of how we're choosing to render content if you somehow shoot past the last page. I'd prefer to have more in place to catch issues like this, instead of hoping the button takes care of everything)

@Parkreiner Parkreiner self-assigned this Nov 7, 2023
Copy link

@cdr-bot cdr-bot bot left a comment

Choose a reason for hiding this comment

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

This PR is a hotfix and has been automatically approved.

  • ✅ Base is main
  • ✅ Has hotfix label
  • ✅ Head is from coder/coder
  • ✅ Less than 100 lines

@Parkreiner Parkreiner merged commit b0aa91b into main Nov 7, 2023
@Parkreiner Parkreiner deleted the mes/bugs/pagination branch November 7, 2023 14:36
@github-actions github-actions bot locked and limited conversation to collaborators Nov 7, 2023
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.

1 participant