react-native-bottom-sheet: [v4] Setting `enableContentPanningGesture` to `false` breaks `BottomSheetScrollView`
Bug
Setting enableContentPanningGesture to false breaks the scroll interaction with BottomSheetScrollView. Namely, while the user’s finger is still down they can move it all they want and the content does not scroll at all, but when they release their finger the momentum is applied.
Environment info
| Library | Version |
|---|---|
| @gorhom/bottom-sheet | 4.1.4 |
| react-native | 0.64.2 |
| react-native-reanimated | 2.2.3 |
| react-native-gesture-handler | 1.10.3 |
Steps To Reproduce
- Make a
BottomSheetwithenableContentPanningGesture={false} - Put a
BottomSheetScrollViewin it with enough contents to make it scroll - Expand the sheet and try to scroll the contents
Describe what you expected to happen:
Setting enableContentPanningGesture to false should disable the ability to collapse the sheet by panning, but it should not affect scrolling the contents.
Reproducible sample code
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 11
- Comments: 70 (19 by maintainers)
@simon-abbott hey, I had a similar issue with a date picker inside modal. I solved the issue by using
BottomSheetViewand inside it usingScrollViewfromreact-native-gesture-handlerimport { ScrollView } from 'react-native-gesture-handler';<BottomSheetView> <ScrollView> {contents} </ScrollView> </BottomSheetView>This is a really aggressive bot… still a problem.
This issue is still not fixed and should not have been closed. @gorhom please re-open.
This issue was closed because it has been stalled for 5 days with no activity.
has anyone got a workaround for this? is this fixed in v5?
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.
Bump!
https://github.com/gorhom/react-native-bottom-sheet/commit/2962a2d5326e517a48fe11d0e0d762beacca890d
mb i wasn’t aware of it, it’s working, i apologize 😅
I would consider this a bug because the prop references the pan gesture and not the scroll. Also it works great in android. However since BottomSheet Scrollables (ex BottomSheetScrollView) are used to achieve a smooth transition between scroll and pan it seems using BottomSheetScrollView with pan disabled seems unnecessary. For now I will do the following:
I am having this issue on
4.6.1. @gorhom Any advice? This issue is years old.Still not fixed.
Still broken, do not close.
bumpity bump
Using a different
ScrollViewdoes work, but the problem is that I need to be able to setenableContentPanningGesturedynamically, and when it’s enabled I need to use aBottomSheetScrollViewso the drag-to-close works as expected. I can swap between the two dynamically based on whether or not the sheet should be enabled, but swapping out the components loses the scroll amount (snaps back to top), and I couldn’t find a clean (and performant) way to preserve the scroll offset through that transition.