react-native-gesture-handler

stop dragging after a limit has reached

天涯浪子 提交于 2021-01-31 07:26:21
问题 I am using react native gesture handlers to create a bar that can be scrolled up and down. Currently I can scroll it as much as I want. I want to modify it such that it should stop scrolling when I certain limit has reached. export const SwipeablePanel: React.FunctionalComponent = () => { //set up animation variables const dragY = useRef(new Animated.Value(0)); const onGestureEvent = Animated.event( [{ nativeEvent: { translationY: dragY.current } }], { useNativeDriver: true, }, ); const

stop dragging after a limit has reached

北城余情 提交于 2021-01-31 07:25:48
问题 I am using react native gesture handlers to create a bar that can be scrolled up and down. Currently I can scroll it as much as I want. I want to modify it such that it should stop scrolling when I certain limit has reached. export const SwipeablePanel: React.FunctionalComponent = () => { //set up animation variables const dragY = useRef(new Animated.Value(0)); const onGestureEvent = Animated.event( [{ nativeEvent: { translationY: dragY.current } }], { useNativeDriver: true, }, ); const

stop dragging after a limit has reached

房东的猫 提交于 2021-01-31 07:24:39
问题 I am using react native gesture handlers to create a bar that can be scrolled up and down. Currently I can scroll it as much as I want. I want to modify it such that it should stop scrolling when I certain limit has reached. export const SwipeablePanel: React.FunctionalComponent = () => { //set up animation variables const dragY = useRef(new Animated.Value(0)); const onGestureEvent = Animated.event( [{ nativeEvent: { translationY: dragY.current } }], { useNativeDriver: true, }, ); const

React Native Swipeable (Swipe to delete) not closing

痴心易碎 提交于 2020-06-25 04:33:08
问题 I'm using Swipeable from React-Native-Gesture-Handler to incorporate swipe to delete on my page. When I press delete, the contact gets deleted however the swipeable remains open. I want it to close after it gets pressed but I can't seem to figure out how to do it. This is my code: const RightActions = (progress, dragX) => { return ( <TouchableOpacity onPress={()=>{DeleteContact(i)}}> <View style={[ContactsStyles.rightAction]}> <Text style={ContactsStyles.actionText}>Delete</Text> </View> <