react-native-swipeable icon indicating copy to clipboard operation
react-native-swipeable copied to clipboard

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

Open livfwd opened this issue 9 years ago • 4 comments

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.

livfwd avatar Apr 19 '17 00:04 livfwd

@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.

marcusegues avatar Mar 14 '18 10:03 marcusegues

@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

livfwd avatar Mar 16 '18 21:03 livfwd

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

nafisholeh avatar Jul 05 '18 12:07 nafisholeh

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

nafisholeh avatar Jul 05 '18 12:07 nafisholeh