React-native-swipe-list-view: How to avoid tap while doing swipe?

Created on 21 Jan 2020  路  6Comments  路  Source: jemise111/react-native-swipe-list-view

Describe the bug
Whenever I swipe to see the options, the touch triggers the tap and goes to a child's view. I would like to know if there is any way to differentiate between tap and swipe.

Not sure if this qualifies as the bug but I really need help.

To Reproduce
In render item return TouchableHighlight and give onPress event to it. When you try to swipe it will trigger the onPress function as well.

Environment (please complete the following information):

  • OS: Android & iOS
  • RN Version: 0.60.5

Most helpful comment

I experienced this - it turned out I was importing TouchableHighlight/TouchableOpacity from react-native-gesture-handler. Importing from 'react-native' solved it.

All 6 comments

just control opacity different for tap and swipe....

can you give more details on how I can handle the opacity for tap and swipe?

Hi @mohitmishra22 can you confirm you have set up your Touchable exactly in this way:

https://github.com/jemise111/react-native-swipe-list-view/blob/master/SwipeListExample/example.js#L128

I do not see the onPress triggered when I swipe the row

Also see this note please: https://github.com/jemise111/react-native-swipe-list-view#note

If you have any other info that would be very helpful

I'm having a similar problem. I'm not using TouchableOpacity, I'm using TouchableHighlight. When I swipe the onPress for the Touchable is firing.

I experienced this - it turned out I was importing TouchableHighlight/TouchableOpacity from react-native-gesture-handler. Importing from 'react-native' solved it.

Closing as inactive, and possibly solved

Was this page helpful?
0 / 5 - 0 ratings

Related issues

alexco2 picture alexco2  路  6Comments

benoitvallon picture benoitvallon  路  6Comments

jwilliamson-qb picture jwilliamson-qb  路  3Comments

Elijen picture Elijen  路  5Comments

imsam67 picture imsam67  路  5Comments