jshanson7 / react-native-swipeable

A powerful React Native swipe component.
MIT License
1.24k stars 269 forks source link

Can only swipe from "Touchable" elements if using inside of modal #10

Open livfwd opened 7 years ago

livfwd commented 7 years ago

First of all, amazing component! Thanks for creating it!

I'm using this inside of a regular component without issue, but when I try to use it inside of a React Native <Modal>, the only elements I can initiate a swipe from are Touchable wrappers. I'm getting around this by wrapping my entire list item inside of TouchableWithoutFeedback wrapper, but I'm curious why the behavior is different inside of a modal?

In both cases, modal and no modal, I am inside of a <ScrollView> - the only difference is the modal.

marcusegues commented 6 years ago

@livfwd Could you provide a code example of how you solved this with the Touchable wrapper?

I also have a ScrollView inside a Modal, but the Swipeable component doesn't work in this case even though I can use it in regular components without modal.

livfwd commented 6 years ago

@marcusegues sure!

Check out: https://github.com/sailor-and-sirens/siren/blob/master/components/AddPlaylistModal.js https://github.com/sailor-and-sirens/siren/blob/master/components/AddPlaylistModalRow.js

nafisholeh commented 6 years ago

@livfwd unfortunately your solution didn't work for me.

nafisholeh commented 6 years ago

it turns out it is my own mistake, I have one of my TouchableOpacity disabled, thus it was useless eventhough I wrap it with TouchableWithoutFeedback