onSnapToItem not called when drag+release in center of item.
See original GitHub issueIs 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 ([]
).)
- I have read the guidelines regarding bug report.
- I have reviewed the documentation in its entirety, including the dedicated documentations 📚.
- I have searched for existing issues and made sure that the problem hasn’t already been reported.
- I am using the latest plugin version.
- I am following the issue template closely in order to produce a useful bug report.
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.
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.)
- Select first item (if not already selected), the item with a
1
. - 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. - If perfectly aligned, onSnapToItem won’t be called and carousel won’t move.
- If onSnapToItem is called, repeat the process until 3. is reproduced.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:6
- Comments:5 (1 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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!
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