react-native-bottom-sheet
react-native-bottom-sheet copied to clipboard
[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
https://snack.expo.dev/@simon.abbott/bottom-sheet-scroll
I'm having the same issue here.
Same problem.
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.
Not fixed, don't close.
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.
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!
@simon-abbott hey, I had a similar issue with a date picker inside modal. I solved the issue by using BottomSheetView
and inside it using ScrollView
from react-native-gesture-handler
import { ScrollView } from 'react-native-gesture-handler';
<BottomSheetView> <ScrollView> {contents} </ScrollView> </BottomSheetView>
Using a different ScrollView
does work, but the problem is that I need to be able to set enableContentPanningGesture
dynamically, and when it's enabled I need to use a BottomSheetScrollView
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.
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.
Not fixed, don't close!
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
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.
bumpity bump
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
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.
Commenting to keep open
same problem here too
please fix this
Same!
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.
Pump
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.
Still a problem, do not close.
@simon-abbott I ran into as similar issue and ended up doing:
enablePanDownToClose={false}
enableOverDrag={false}>
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.
Not fixed yet!
any solution