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
BottomSheet
withenableContentPanningGesture={false}
- Put a
BottomSheetScrollView
in 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 3 years ago
- Reactions: 8
- Comments: 60 (17 by maintainers)
@simon-abbott hey, I had a similar issue with a date picker inside modal. I solved the issue by using
BottomSheetView
and inside it usingScrollView
fromreact-native-gesture-handler
import { 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.
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.
has anyone got a workaround for this? is this fixed in v5?
Still not fixed.
Still broken, do not close.
bumpity bump
Using a different
ScrollView
does work, but the problem is that I need to be able to setenableContentPanningGesture
dynamically, and when it’s enabled I need to use aBottomSheetScrollView
so 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.Bump!