snapTo method always snapping to the highest snap point
See original GitHub issueOS: 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:
- Created 4 years ago
- Reactions:15
- Comments:9
Top 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 >
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 Free
Top 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
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#L660setTimeout(() => this.isManuallySetValue.setValue(1), 0);
Nowthis.manuallySetValue
has the correct value whenthis.isManuallySetValue(1)
is run.I was experiencing this exact issue, using
v1.0.0-alpha.22
, with the following dependencies installed:I updated both, and the issue was no more.
Hope this helps someone!