React-native-swipe-list-view: Programatically disable swipe behavior?

Created on 26 Feb 2019  路  6Comments  路  Source: jemise111/react-native-swipe-list-view

Is there any way to disable the swipe behavior? I know that sounds like a ridiculous request, but I'd like to use this library, but not allow users access to the swipe functionality until I've had some more time to build it out.

Most helpful comment

All 6 comments

@Slapbox I haven't tried it but would disableLeftSwipe={true} and disableRightSwipe={true} do the trick?

Might not be the most efficient way but they do already exist

@jemise111 that sounds like exactly what I'd need! Thanks for your quick response!

Oddly, swiping right is still something I can do after adding those to the <SwipeListView /> component. It seems to prevent it about 90% of the time, but sometimes I can still swipe it. Swiping left seems to be 100% disabled, but swiping right is not 100% disabled.

@Slapbox Hm, can you post your code? Will try to take a look when I can

Additionally the real "right" way to do this is to prevent the gesture handler from accepting gestures in the first place if a certain prop is passed. Will also try to do then when I can but if you want to give it a shot and submit a PR, it's always welcome :)

Closing, please reopen if this is still an issue, thanks!

Is here any way to do it only for some items? I want to make it disabled conditionally - depended on item but I can't pass there callback - only boolean value.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

terencestone picture terencestone  路  5Comments

Slapbox picture Slapbox  路  3Comments

bohdan145 picture bohdan145  路  6Comments

imsam67 picture imsam67  路  5Comments

alexco2 picture alexco2  路  6Comments