snapTo snapping to the wrong SnapPoint
See original GitHub issueI have a simple sheet component with 3 buttons:
export const SimpleSheet: React.FC = (): JSX.Element => {
const bs = useRef<BottomSheet>(null)
const renderContent = () => (
<View style={styles.content}>
<Button title="Top" onPress={() => { bs?.current?.snapTo(2) }} />
<Button title="Center" onPress={() => { bs?.current?.snapTo(1) }} />
<Button title="Bottom" onPress={() => { bs?.current?.snapTo(0) }} />
</View>
)
return (
<BottomSheet
ref={bs}
snapPoints={[125, '50%', '95%']}
initialSnap={1}
renderContent={renderContent}
/>
)
}
-
I press the Top button -> snap to top
-
I press the Bottom button -> nothing happens
-
I press the Center button -> snap to bottom
It seems as the component is remembering the last snap point it is supposed to snap to and performs the action after the next snapTo.
happend on current npm version 1.0.0-alpha.18 on iOS
Thanks in advance
Issue Analytics
- State:
- Created 4 years ago
- Reactions:15
- Comments:14
Top Results From Across the Web
Snap Point Locations Seem "Off" : r/NoMansSkyTheGame
I don't even know how to explain this - but snap points and the translucent part "shadows" seem to be in the wrong...
Read more >Adjust snap strength or turn snap off - Microsoft Support
Under Snap to, select the drawing elements that you want shapes to snap into alignment with, and then click OK. The snap settings...
Read more >Cursor skips over some object snaps and will not snap when ...
Unable to snap to precise points. The cursor seems to miss or hop over them.
Read more >Snap point to point with St_Snap Postgis - GIS Stack Exchange
A quick hack to guarantee that you always snap to the closest point: SELECT f.gid AS gid, ST_Snap( f.Geom, ST_ClosestPoint(g.Geom, f.
Read more >When You Pipe to a Head, the "Snap" Point is Wrong - Land FX
Issue When you pipe to a sprinkler head in your design, the "snap" point seems to be incorrect. The lateral pipe is not...
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
bs = React.createRef(null);
<BottomSheet ref={this.bs} snapPoints={[330, 0]} borderRadius={10} /> i use with this keyword fixed
call ref like this : this.bs.current.snapTo(1);
downgrade version to ‘1.0.0-alpha.14’ works for me !