Skip to content

fix(pagination): support controlled page state - #694

Closed
2xburnt wants to merge 1 commit into
ping-pub:masterfrom
burnt-labs:feat/pagination
Closed

fix(pagination): support controlled page state#694
2xburnt wants to merge 1 commit into
ping-pub:masterfrom
burnt-labs:feat/pagination

Conversation

@2xburnt

@2xburnt 2xburnt commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

This pull request updates the PaginationBar.vue component to improve its reactivity and styling. The main changes ensure that the current page state stays in sync with the page prop and enhances the pagination bar's appearance.

Reactivity improvements:

  • The current page state is now initialized from the page prop, and a watch is added to keep current in sync if the page prop changes.

Styling enhancements:

  • The pagination button container now uses utility classes for improved layout and responsiveness, replacing the previous btn-group class.Keep the selected page synchronized with consumers while allowing pagination controls to wrap on narrow screens.

Keep the selected page synchronized with consumers while allowing pagination controls to wrap on narrow screens.

Co-authored-by: Cursor <cursoragent@cursor.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b93d0d2eeb

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

});
const current = ref(1);
const current = ref(props.page);
watch(() => props.page, (page) => (current.value = page));

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Keep controlled selection sourced from the page prop

When a controlled consumer keeps page unchanged—for example, because navigation is rejected or its request fails—gotoPage() still changes current, while this watcher never runs because the prop value did not change. The bar therefore highlights the attempted page even though the controlling state still points to the previous page. In controlled mode, avoid mutating the displayed selection independently of page, or restore it when the callback does not update the prop.

Useful? React with 👍 / 👎.

@2xburnt 2xburnt closed this Jul 28, 2026
@2xburnt
2xburnt deleted the feat/pagination branch July 28, 2026 01:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant