huntabyte / bits-ui

The headless components for Svelte.
https://bits-ui.com
MIT License
1.19k stars 86 forks source link

fix: call `onPageChange` after setting the `page` #657

Closed UltraSive closed 2 weeks ago

UltraSive commented 3 weeks ago

Typically onPageChange calls a function and the state of the function is incorrect for the new page because the bound variable page is still old.

changeset-bot[bot] commented 3 weeks ago

🦋 Changeset detected

Latest commit: 06749203324166d7e70affc7bc99d9e7afdb0580

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package | Name | Type | | ------- | ----- | | bits-ui | Patch |

Not sure what this means? Click here to learn what changesets are.

[Click here if you're a maintainer who wants to add another changeset to this PR](https://github.com/UltraSive/bits-ui/new/UltraSive-pagination-patch-onPageChange-order?filename=.changeset/big-countries-punch.md&value=---%0A%22bits-ui%22%3A%20patch%0A---%0A%0Afipped%20onPageChange()%20w%2F%20setting%20the%20page%0A)

github-actions[bot] commented 2 weeks ago
built with Refined Cloudflare Pages Action

âš¡ Cloudflare Pages Deployment

Name Status Preview Last Commit
bits-ui ✅ Ready (View Log) Visit Preview 06749203324166d7e70affc7bc99d9e7afdb0580