Skip to content

Conversation

hungtrn75
Copy link

@hungtrn75 hungtrn75 commented Aug 21, 2025

Description

Fixed edge case where left overscroll at first page with loop=false would cause incorrect page calculation when subsequently calling next() or scrollTo() methods. The fix ensures proper page index handling during boundary overscroll scenarios.

Changes:

  • Updated currentFixedPage() calculation logic to handle left overscroll at first page correctly
  • Updated handlerOffsetDirection() to return consistent direction for small positive offsets when loop=false
  • Added comprehensive test coverage for overscroll scenarios

Review

  • I self-reviewed this PR

The changes maintain all existing library behaviors while fixing the overscroll edge case

Testing

  • I added/updated tests
  • Existing tests still pass
  • I manually tested

Manual testing performed:

  • Verified the fix resolves the specific overscroll issue shown in the attached video
Simulator.Screen.Recording.-.iPhone.16.Pro.-.2025-08-20.at.11.32.55.mp4

Copy link

changeset-bot bot commented Aug 21, 2025

⚠️ No Changeset found

Latest commit: c663753

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link

vercel bot commented Aug 21, 2025

@hungtranauthentia is attempting to deploy a commit to the Caspian's Team Team on Vercel.

A member of the Team first needs to authorize it.

@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. bug Something isn't working labels Aug 21, 2025
@hungtrn75 hungtrn75 changed the title Fix: prevent incorrect page calculation when calling next() or scrollTo() after right overscroll at first page with loop=false and overscrollEnabled=true Fix: prevent incorrect page calculation when calling next() or scrollTo() after right overscroll Aug 21, 2025
@hungtrn75 hungtrn75 changed the title Fix: prevent incorrect page calculation when calling next() or scrollTo() after right overscroll Fix: prevent incorrect page calculation when calling next() or scrollTo() after left overscroll at first page Aug 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working size:L This PR changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants