Open thomasdittmar opened 3 years ago
I created a PR but I don't have permission to push. Let me know if you are interested.
I'm not sure I fully understand your useCase, you get a percentOpen
animated value that you should be use to roll your own event that triggers on swipe start:
https://github.com/computerjazz/react-native-swipeable-item#props
something like:
const MyComponent = ({ percentOpen }) => {
const hasBegun = useMemo(() => greaterThan(percentOpen, 0), [])
useCode(() => {
onChange(hasBegun, cond(hasBegun, call([hasBegun], () => {
console.log("swipe started!!" )
}) ))
}, [hasBegun])
}
@thomasdittmar I've got the same issue. I have a touchable item that you can swipe right to click delete but no matter what when you swipe right it invokes the onPress for the touchable.
What was your fix for this?
@Brune04 I used TouchableOpacity from react-native-gesture-handler that resolved this problem
First of all everything works as expected. Hence, this is not really a bug report.
In my instance I use
react-native-swipeable-item
together withreact-native-draggable-flatlist
but the Row would have an additionalTouchableOpacity
something like thatThe setup is like the Google mail app, only that one can't reorder the items. In the Google mail app one can swipe left or right or click on the row to see the content of the mail.
I would like the same outcome but once I begin to swipe the
onPress
of the main row gets invoked before theonChange
event. It would look like that if I log out the value of the onChange event.Is there a way to accomplish this?
SwipeableItem
would need an extra event that get's invoked as soon as the swipe starts so the onPress of 2nd TouchableOpacity can be disabled, right?