question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

onSnapToItem not called when drag+release in center of item.

See original GitHub issue

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?

Yes.

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

Both platforms. Happens on all versions I’ve tested so far.

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

Yes

Environment

Environment: React: 16.9.0 React native: 0.61.5 react-native-snap-carousel: 3.8.4

Target Platform: iOS (13.2.2)

Expected Behavior

Dropping the control in the center of a new item should fire onSnapToItem, as it does when it dropped anywhere else.

Actual Behavior

Dropping the control in the exact center of a new item doesn’t fire onSnapToItem. But it does fire when moving away from the item. See the gif below.

rnsc-dragging-issue

Reproducible Demo

https://snack.expo.io/S1rs_rpaB

Steps to Reproduce

(Write your steps so that anyone can reproduce the issue in the Snack demo you provided.)

  1. Select first item (if not already selected), the item with a 1.
  2. Drag the next item (2), and move it to the center of the screen, and release it when the black line in the item is perfectly aligned with the black line in the view behind it.
  3. If perfectly aligned, onSnapToItem won’t be called and carousel won’t move.
  4. If onSnapToItem is called, repeat the process until 3. is reproduced.

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:6
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
bd-arccommented, Apr 6, 2020

Can you try the shiny new beta version and let me know how it works for you?

Click here to learn everything about the upcoming v4!

0reactions
dohooocommented, Oct 8, 2021

Sorry, please allow me to advertise for my open source library! ~ I think this library react-native-reanimated-carousel will solve your problem. It is a high performance and very simple component, complete with React-Native reanimated 2

Read more comments on GitHub >

github_iconTop Results From Across the Web

onSnapToItem is not fired when difference between ... - GitHub
You'll see that onSnapToItem does not fire even though visually, the carousel snaps. i noticed that onSnapToItem will fire if i reduce itemWidth ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found