meliorence / meliorence/react-native-snap-carousel

Floating point precision runs into weird behavior in looping mode

Open
#560 10 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
10.5k
Forks
2.3k
PR merge metrics
No merged PRs in 30d

Description

#286 # Is this a bug report, a feature request, or a question?

bug report

Have you followed the required steps before opening a bug report?

(Check the step you've followed - put an x character between the square brackets ([]).)

Have you made sure that it wasn't a React Native bug?

I can't find anything about this issue.

Is the bug specific to iOS or Android? Or can it be reproduced on both platforms?

iOS 12.2
Android Simulator on Snack

Is the bug reproductible in a production environment (not a debug one)?

Yes.

Environment

Environment:
React: 16.5.0
React native: 0.57 (Expo SDK 32.0.0)
react-native-snap-carousel: 3.8.0

Target Platform:
Android (5.0)
iOS (9.2)

Expected Behavior

The slides looping on both sides endlessly.

Actual Behavior

The slides loop only once (regarding loopClonesPerSide) on the right side (swiping to left). On the other side, everything works as intended.

floating_error_carousel

Reproducible Demo

https://snack.expo.io/@thehacky/floating-point-error-in-carousel

Steps to Reproduce
  1. Swipe to left until no item will be rendered

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked reproducible Expo Snack and follow the listed swipe steps on Android or iOS, focusing on looping with loopClonesPerSide. Compare the right-side and left-side behavior; the issue is done when slides continue looping endlessly in both directions without items disappearing.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, react-native
Domain
mobile
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.