Horizontal Carousel scrolling conflicts with vertical ScrollView scrolling #588
-
I have this horizontal parallax carousel that is inside a ScrollView that has vertical scrolling. As my Carousel is in the middle of the view, sometimes it's necessary for the user to touch the carousel, but with a vertical scroll intention. As they want to scroll the ScrollView and not interact with the Carousel. But the Carousel "captures" the Pan gesture and prevents the vertical scrolling from happening in the ScrollView. Have you faced this? Is there a prop to somehow provide a treshold to what should be detected as a horizontal interaction with the Carousel vs a vertical scroll intention? I tried to add Note: I didn't created it as an issue as I didn't have the time to create a reproducible example, but I guess the description here is clear. Any ideas? Thank you |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
This has worked well for me:
Explanation: activeOffsetX: [-10, 10]: This configures the gesture handler to activate horizontal panning when the gesture's x-axis movement is between -10 and 10. It helps in recognizing horizontal swipes effectively. failOffsetY: [-5, 5]: This sets the gesture handler to fail (thus not capturing the gesture) when a vertical movement of more than 5 units in either direction is detected. This allows the ScrollView to take over when vertical scrolling is detected. |
Beta Was this translation helpful? Give feedback.
This has worked well for me:
Explanation:
activeOffsetX: [-10, 10]: This configures the gesture handler to activate horizontal panning when the gesture's x-axis movement is between -10 and 10. It helps in recognizing horizontal swipes effectively.
failOffsetY: [-5, 5]: This sets the gesture handler to fail (thus not capturing the gesture) when a vertical movement of more than 5 units in either direction is detected. This allows the ScrollView to take over when vertical scrolling is detected.