dohooo / react-native-reanimated-carousel

🎠 React Native swiper/carousel component, fully implemented using reanimated v2, support to iOS/Android/Web. (Swiper/Carousel)
https://react-native-reanimated-carousel.vercel.app
MIT License
2.73k stars 317 forks source link

scrolling problem #615

Open huseyintopuz opened 4 months ago

huseyintopuz commented 4 months ago

i have a horizontal carousel. if i scroll down on carousel, it still scrolling horizontally how to prevent this ?.

dosubot[bot] commented 4 months ago

To prevent your horizontal carousel from scrolling horizontally when you try to scroll down and ensure that vertical scrolling works as expected, you can use the panGestureHandlerProps to configure the gesture handler. Here's a solution that has worked well:

panGestureHandlerProps={{
  activeOffsetX: [-10, 10], // Enable horizontal panning
  failOffsetY: [-5, 5],    // Limit vertical movement to fail the gesture
}}

Explanation:

For more details, you can refer to a similar discussion here [1].

#### Details **About Dosu** This response is meant to be useful and save you time. It is **not meant to be a precise solution**, but rather a starting point for your own research. Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant.

To continue the conversation, mention @dosu.

huseyintopuz commented 4 months ago

thanks it works