webraptor / react-native-deck-swiper

tinder like react-native deck swiper
ISC License
126 stars 81 forks source link

ScrollView inside card #63

Closed haveamission closed 1 year ago

haveamission commented 2 years ago

Is it possible to have a ScrollView that works inside a card?

I want to essentially have my arbitrary card, let me give a toy example:

<View>
...contents
</View>

And among those contents, I want to have a <ScrollView /> that scrolls. Right now when I try to scroll on the scrollview, I can't, it just drags the card.

thekundan2022 commented 1 year ago

Hi @haveamission Have you got any solutions for this..?

haveamission commented 1 year ago

@thekundan2022 Yeah, it was some convoluted thing with gesture handling if I recall correctly.

I'll take a look at the code a bit later today and see what I ended up doing exactly.

haveamission commented 1 year ago

So as far as I can tell, I just put this into the ScrollView (and also the child View, but I don't think that was necessary):

              onStartShouldSetResponder={() => true}
              onTouchEnd={e => {
                e.stopPropagation();
              }}

Let me know if that helps

webraptor commented 1 year ago

https://github.com/webraptor/react-native-deck-swiper/issues/22