Skip to content

Commit

Permalink
fix: call onPageChange after setting the page (#657)
Browse files Browse the repository at this point in the history
Co-authored-by: Hunter Johnston <64506580+huntabyte@users.noreply.github.com>
  • Loading branch information
UltraSive and huntabyte authored Sep 12, 2024
1 parent 7539bf5 commit 48d9002
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/plenty-pears-add.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"bits-ui": patch
---

fix(Pagination): call `onPageChange` _after_ setting the `page`
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
defaultPage: page,
onPageChange: ({ next }) => {
if (page !== next) {
onPageChange?.(next);
page = next;
onPageChange?.(next);
}
return next;
Expand Down

0 comments on commit 48d9002

Please sign in to comment.