react-native-reanimated-bottom-sheet
react-native-reanimated-bottom-sheet copied to clipboard
react-native-community/viewpager inside Bottomsheet in android not scrolling
You can scroll the viewPager only if you use 2 fingers.
Any hints?
We do want to keep the gestures enabled for the bottomsheet, if possible
@mitsest use FlatlLst
or ScrollView
from react-native-gesture-handler
In addition to what @ruslan-hontar suggested, If You also set the nested ScrollView / FlatList style to have a zIndex : 1 , then the first tap gesture made should be detected by the scrolling view before the bottom sheet. this was my only working work around for nested scroll view in BottomSheet for Android. Still works the same on IOS.
I discovered a workaround for this. I use a <ViewPager />
(now called <PagerView />
) in my bottom sheet and couldn't get it to scroll horizontally on Android.
What I did was set enabledGestureInteraction
to false
and wrapped my bottom sheet component that gets rendered in the renderContent
prop of the <BottomSheet />
in 2 <FlingGestureHandler />
components from react-native-gesture-handler
--one to track an upwards fling and one to track a downwards fling. Then I just used the bottomSheetRef.snapTo(index)
whenever it registers a fling event to snap to the correct view. Not quite as smooth but still works well!