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.

snapTo method always snapping to the highest snap point

See original GitHub issue

OS: iOS 13.3 Pre-release: v1.0.0-alpha.18

Peer dependencies:

  • react: v16.8.6
  • react-native: v0.59.9
  • react-native-gesture-handler: v1.3.0
  • react-native-reanimated: v1.5.0 / v1.6.0 / v.1.7.0

The snapTo method always snaps to the highest snap point on first call. Calling it a second time with the same index does make the bottom sheet snap to the actual snap point defined at that index.

I divided a bit into the issue and it seems to be related to recent releases of react-native-reanimated (v1.5.0, v1.6.0 & v1.7.0) The issue doesn’t occur on v1.4.0.

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:15
  • Comments:9

github_iconTop GitHub Comments

5reactions
TheDuccommented, Feb 19, 2020

I am not that familiar with reanimated, but it seems like some kind of race condition. The animation seems to start before this.manuallySetValue has the correct value. I worked around this by adding a timeout here https://github.com/osdnk/react-native-reanimated-bottom-sheet/blob/df2f054a8e4e738ccb4aa264fb8f6c07f819d433/src/index.tsx#L660 setTimeout(() => this.isManuallySetValue.setValue(1), 0); Now this.manuallySetValue has the correct value when this.isManuallySetValue(1) is run.

1reaction
joelrorsethcommented, Sep 11, 2020

I was experiencing this exact issue, using v1.0.0-alpha.22, with the following dependencies installed:

react-native-gesture-handler: v1.6.1
react-native-reanimated: v1.8.0

I updated both, and the issue was no more.

react-native-gesture-handler: v1.8.0
react-native-reanimated: v1.13.0

Hope this helps someone!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Getting Started with SNAPPING in Blender ... - YouTube
In this video, I wanted to talk about some of the snap functions contained inside of Blender to help you make precise movements...
Read more >
The Weekly Houdini Tutorial: Snapping Pt. 1/5 - YouTube
... Snapping Pt. 1/5 – The Basics (Grid, Point, Primitive, Multi- Snap ) ... Your way of teaching Houdini makes the software less...
Read more >
Docs | GSAP | Utility Methods | snap() - GreenSock
snap () Snap to a certain increment or to the closest value in an Array. You can optionally limit snapping to only occur...
Read more >
Choose Snapping Point? - Blender Stack Exchange
Now Left-drag the 'From' object to the 'To' object, with Ctrl, hovering over the target 'To' vertex. The 'From' point will snap to...
Read more >
Snapping - affinity.help
You can also snap to object bounding boxes, key points on shapes, and to an object's geometry. Text can also snap to the...
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