react-native-bottom-sheet icon indicating copy to clipboard operation
react-native-bottom-sheet copied to clipboard

[v4] Setting `enableContentPanningGesture` to `false` breaks `BottomSheetScrollView`

Open simon-abbott opened this issue 3 years ago • 21 comments

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

  1. Make a BottomSheet with enableContentPanningGesture={false}
  2. Put a BottomSheetScrollView in it with enough contents to make it scroll
  3. 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

simon-abbott avatar Dec 02 '21 17:12 simon-abbott

I'm having the same issue here.

zakthedev avatar Dec 10 '21 15:12 zakthedev

Same problem.

dentep avatar Dec 27 '21 08:12 dentep

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.

github-actions[bot] avatar Jan 26 '22 09:01 github-actions[bot]

Not fixed, don't close.

simon-abbott avatar Jan 26 '22 16:01 simon-abbott

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.

github-actions[bot] avatar Feb 27 '22 09:02 github-actions[bot]

Bump.

simon-abbott avatar Feb 28 '22 16:02 simon-abbott

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.

github-actions[bot] avatar Apr 01 '22 09:04 github-actions[bot]

Bump!

simon-abbott avatar Apr 01 '22 14:04 simon-abbott

@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>

DominykasDriu avatar Apr 05 '22 11:04 DominykasDriu

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.

simon-abbott avatar Apr 07 '22 17:04 simon-abbott

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.

github-actions[bot] avatar May 08 '22 09:05 github-actions[bot]

Not fixed, don't close!

simon-abbott avatar May 09 '22 15:05 simon-abbott

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.

github-actions[bot] avatar Jun 10 '22 09:06 github-actions[bot]

bump

simon-abbott avatar Jun 10 '22 15:06 simon-abbott

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.

github-actions[bot] avatar Jul 11 '22 09:07 github-actions[bot]

bumpity bump

simon-abbott avatar Jul 11 '22 15:07 simon-abbott

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.

github-actions[bot] avatar Aug 11 '22 09:08 github-actions[bot]

bump

simon-abbott avatar Aug 11 '22 18:08 simon-abbott

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.

github-actions[bot] avatar Sep 11 '22 09:09 github-actions[bot]

Commenting to keep open

simon-abbott avatar Sep 12 '22 15:09 simon-abbott

same problem here too

lucarducci avatar Sep 22 '22 15:09 lucarducci

please fix this

cuanclifford avatar Oct 12 '22 09:10 cuanclifford

Same!

AliMSbaee avatar Nov 08 '22 09:11 AliMSbaee

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.

github-actions[bot] avatar Dec 08 '22 09:12 github-actions[bot]

Pump

AliMSbaee avatar Dec 08 '22 13:12 AliMSbaee

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.

github-actions[bot] avatar Jan 09 '23 09:01 github-actions[bot]

Still a problem, do not close.

simon-abbott avatar Jan 09 '23 17:01 simon-abbott

@simon-abbott I ran into as similar issue and ended up doing:

      enablePanDownToClose={false}
      enableOverDrag={false}>

keithluchtel avatar Jan 21 '23 18:01 keithluchtel

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.

github-actions[bot] avatar Feb 21 '23 09:02 github-actions[bot]

Not fixed yet!

simon-abbott avatar Feb 22 '23 17:02 simon-abbott

any solution

Zakyyy avatar Mar 09 '23 13:03 Zakyyy