Closed aike19115 closed 1 year ago
@aikewoody Following this as having a similar issue with integrating rn-range-slider with the sheet modal.
Precise horizontal movements are required to drag the range slider thumbs, otherwise the bottom sheet drags and the range slider doesn't function. Ideally the bottom sheet should be lockable from being draggable whilst pressing the range slider., but that doesn't appear to be part of the current bottom sheet API?
I can actually recreate this as well, but I'm seeing it on Android. I am using ExpoAV and am playing a video that is in a BottomSheet view (so that I can do a "YouTube" like mini-player). The seek bar on the video "does not work" because the BottomSheet is "catching it" somehow. The problem isn't as prevalent on iOS for me...it does happen sometimes...but it is consistently there on Android to the degree that users have reported the Android player as "broken".
When I maximize the Android player (fullscreen), the issue goes away because the video is now an overlay on top of the app which overrides the BottomSheet. If I get lucky, I can "tap" on the seek bar at a certain point and that works..but that's inconsistent.
I have tried simple things like zIndex, but that doesn't work. I get the intricacies of the problem..what's a horizontal movement vs what is a vertical movement and when to "lock" and when to not....
My only thought would be "is it possible for a view to be 'on top of' the bottom sheet such that it 'wins'" (which is why I was trying zIndex. Open to suggestions....
@doug-shontz adding enableContentPanningGesture={false}
to BottomSheetModal
has fixed this for me now. Just be aware of https://github.com/gorhom/react-native-bottom-sheet/issues/765
@aikewoody
@SKempin Thanks for that! That did indeed solve our issue!
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.
This issue was closed because it has been stalled for 5 days with no activity.
The bug is still there 🥲
@Spharian did you try this https://github.com/gorhom/react-native-bottom-sheet/issues/1300#issuecomment-1483080021 ?
@Spharian did you try this #1300 (comment) ?
Yes, did solve the issue but makes the scroll buggy as it is mentionned here: https://github.com/gorhom/react-native-bottom-sheet/issues/765
So it's not a viable solution :(
I did this patch and it works fine:
index 377b2d5..19a8629 100644
--- a/node_modules/@gorhom/bottom-sheet/src/components/bottomSheetDraggableView/BottomSheetDraggableView.tsx
+++ b/node_modules/@gorhom/bottom-sheet/src/components/bottomSheetDraggableView/BottomSheetDraggableView.tsx
@@ -76,7 +76,7 @@ const BottomSheetDraggableViewComponent = ({
onGestureEvent={gestureHandler}
activeOffsetX={activeOffsetX}
activeOffsetY={activeOffsetY}
- failOffsetX={failOffsetX}
+ failOffsetX={0}
failOffsetY={failOffsetY}
>
<Animated.View style={style} {...rest}>
I did this patch and it works fine:
index 377b2d5..19a8629 100644 --- a/node_modules/@gorhom/bottom-sheet/src/components/bottomSheetDraggableView/BottomSheetDraggableView.tsx +++ b/node_modules/@gorhom/bottom-sheet/src/components/bottomSheetDraggableView/BottomSheetDraggableView.tsx @@ -76,7 +76,7 @@ const BottomSheetDraggableViewComponent = ({ onGestureEvent={gestureHandler} activeOffsetX={activeOffsetX} activeOffsetY={activeOffsetY} - failOffsetX={failOffsetX} + failOffsetX={0} failOffsetY={failOffsetY} > <Animated.View style={style} {...rest}>
Hmm is that merged in the core package? Made the change locally and it's still causing problems.
I did this patch and it works fine:
index 377b2d5..19a8629 100644 --- a/node_modules/@gorhom/bottom-sheet/src/components/bottomSheetDraggableView/BottomSheetDraggableView.tsx +++ b/node_modules/@gorhom/bottom-sheet/src/components/bottomSheetDraggableView/BottomSheetDraggableView.tsx @@ -76,7 +76,7 @@ const BottomSheetDraggableViewComponent = ({ onGestureEvent={gestureHandler} activeOffsetX={activeOffsetX} activeOffsetY={activeOffsetY} - failOffsetX={failOffsetX} + failOffsetX={0} failOffsetY={failOffsetY} > <Animated.View style={style} {...rest}>
Hmm is that merged in the core package? Made the change locally and it's still causing problems.
did something work? every other suggestion makes it a very buggy experience, not at all comparable to a native one that I saw a app using.
I did this patch and it works fine:
index 377b2d5..19a8629 100644 --- a/node_modules/@gorhom/bottom-sheet/src/components/bottomSheetDraggableView/BottomSheetDraggableView.tsx +++ b/node_modules/@gorhom/bottom-sheet/src/components/bottomSheetDraggableView/BottomSheetDraggableView.tsx @@ -76,7 +76,7 @@ const BottomSheetDraggableViewComponent = ({ onGestureEvent={gestureHandler} activeOffsetX={activeOffsetX} activeOffsetY={activeOffsetY} - failOffsetX={failOffsetX} + failOffsetX={0} failOffsetY={failOffsetY} > <Animated.View style={style} {...rest}>
Hmm is that merged in the core package? Made the change locally and it's still causing problems.
No, It's not merged in core package, I used patch-package
for making this patch.
I did this patch and it works fine:
index 377b2d5..19a8629 100644 --- a/node_modules/@gorhom/bottom-sheet/src/components/bottomSheetDraggableView/BottomSheetDraggableView.tsx +++ b/node_modules/@gorhom/bottom-sheet/src/components/bottomSheetDraggableView/BottomSheetDraggableView.tsx @@ -76,7 +76,7 @@ const BottomSheetDraggableViewComponent = ({ onGestureEvent={gestureHandler} activeOffsetX={activeOffsetX} activeOffsetY={activeOffsetY} - failOffsetX={failOffsetX} + failOffsetX={0} failOffsetY={failOffsetY} > <Animated.View style={style} {...rest}>
Thanks, it solved for me!
Actually I didn't even need to patch the package, I am using ^v4
and this can be passed as a prop to BottomSheet
component:
<BottomSheet
failOffsetX={0}
// ...
Now both "swipe down to close" and horizontal navigation gestures work well.
First of all I would like to thank @gorhom for creating this module, making it open source and maintaining it! 🙏
ps: this issue is only on iOS devices
Bug
See the video for a demo of the issue: https://user-images.githubusercontent.com/17004429/220671117-e0131d93-7169-429b-b4d6-88f7aac5b813.mov
When using the
BottomSheetFlatList
component to render a list inside the bottom sheet the horizontal swipe gestures are "blocked". In combination with using aTabView
this results in the issue that swipe to left/right doesn't work.Environment info
Steps To Reproduce
See the GitHub repo with a minimal, reproducible example: https://github.com/aikewoody/example-react-native-bottom-sheet
Reproducible sample code
See the snack: https://snack.expo.dev/@aikewoody/example-react-native-bottom-sheet