react-native-reanimated-carousel icon indicating copy to clipboard operation
react-native-reanimated-carousel copied to clipboard

feat: added onSnapToItem trigger for didMount and update index changing logic

Open karkengc opened this issue 1 year ago • 5 comments

Changes made is to fix below issue:

  1. No onSnapToItem trigger for initially mounted carousel item
  2. For when loop is true, the index changes when scrolling beyond 1 loop and back to index=0, the index is first changed to rawDataLength before resetting to 0, which will cause slight delay when updating pagination dots.

karkengc avatar Jan 08 '24 02:01 karkengc

⚠️ No Changeset found

Latest commit: 35a593094b260a058005d9736d088431348a6292

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

changeset-bot[bot] avatar Jan 08 '24 02:01 changeset-bot[bot]

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
react-native-reanimated-carousel ❌ Failed (Inspect) Jan 8, 2024 2:43am

vercel[bot] avatar Jan 08 '24 02:01 vercel[bot]

Hi @karkengc, let me test it out and see if I can merge it. thank you :)

oliverloops avatar Jan 08 '24 04:01 oliverloops

Hi @karkengc, let me test it out and see if I can merge it. thank you :)

Hi @oliverloops, just wondering have you gone through it yet 😀

karkengc avatar Feb 16 '24 02:02 karkengc

Hi @karkengc , don't know if you will find this useful but basically this is what I did this in order to fix the delay

using the exported fn onProgressChange I use the following handler

const handleProgressChange = (_: number, progress: number) => setCurrentIndex(Math.round(progress) % data.length);

manuwebs avatar Feb 16 '24 05:02 manuwebs