meliorence / react-native-snap-carousel

Swiper/carousel component for React Native featuring previews, multiple layouts, parallax images, performant handling of huge numbers of items, and more. Compatible with Android & iOS.
BSD 3-Clause "New" or "Revised" License
10.36k stars 2.29k forks source link

Disabled swipe partially #433

Open rollsroyc3 opened 5 years ago

rollsroyc3 commented 5 years ago

Is this a bug report, a feature request, or a question?

Question

I am using the carousels to show cards, which essentially have a header with a list under them. These list rows use react native swipeout to show edit/delete menu options. But this causes an issue with the carousel swipe, is it possible to disable the carousel swipe on a container (the list), but allow the swipe to work on the top half, like in the image below?

carousel question

bd-arc commented 5 years ago

Hi @rollsroyc3,

I don't see any easy solution to your problem. Using multiple touch-aware libraries together usually lead to issues because one always take precedence over the others.

You can try creating an absolutely-positioned PanResponder over the rows that would receive the touch events, bypass the carousel, and "forward" them to the rows. To be honest, I don't have much clue about this solution.

react-native-snap-carousel issue 433

I would personally go with the following:

react-native-snap-carousel issue 433

rollsroyc3 commented 5 years ago

OK, thanks for the detailed response. Im going to look into the second solution.

dohooo commented 3 years ago

Sorry, please allow me to advertise for my open source library! ~ I think this library react-native-reanimated-carousel will solve your problem. It is a high performance and very simple component, complete with React-Native reanimated 2