gorhom / react-native-bottom-sheet

A performant interactive bottom sheet with fully configurable options 🚀
https://ui.gorhom.dev/components/bottom-sheet
MIT License
6.66k stars 740 forks source link

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

Closed simon-abbott closed 8 months ago

simon-abbott commented 2 years ago

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

zakthedev commented 2 years ago

I'm having the same issue here.

dentep commented 2 years ago

Same problem.

github-actions[bot] commented 2 years ago

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.

simon-abbott commented 2 years ago

Not fixed, don't close.

github-actions[bot] commented 2 years ago

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.

simon-abbott commented 2 years ago

Bump.

github-actions[bot] commented 2 years ago

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.

simon-abbott commented 2 years ago

Bump!

DominykasDriu commented 2 years ago

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

`

{contents}

`

simon-abbott commented 2 years ago

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.

github-actions[bot] commented 2 years ago

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.

simon-abbott commented 2 years ago

Not fixed, don't close!

github-actions[bot] commented 2 years ago

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.

simon-abbott commented 2 years ago

bump

github-actions[bot] commented 2 years ago

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.

simon-abbott commented 2 years ago

bumpity bump

github-actions[bot] commented 2 years ago

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.

simon-abbott commented 2 years ago

bump

github-actions[bot] commented 2 years ago

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.

simon-abbott commented 2 years ago

Commenting to keep open

lucarducci commented 1 year ago

same problem here too

cuanclifford commented 1 year ago

please fix this

github-actions[bot] commented 1 year ago

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.

AliMSbaee commented 1 year ago

Pump

github-actions[bot] commented 1 year ago

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.

simon-abbott commented 1 year ago

Still a problem, do not close.

keithluchtel commented 1 year ago

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

      enablePanDownToClose={false}
      enableOverDrag={false}>
github-actions[bot] commented 1 year ago

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.

simon-abbott commented 1 year ago

Not fixed yet!

Zakyyy commented 1 year ago

any solution

keithluchtel commented 1 year ago

@Zakyyy Does the alternative I posted above work?

https://github.com/gorhom/react-native-bottom-sheet/issues/765#issuecomment-1399311529

Zakyyy commented 1 year ago

@keithluchtel the thing is I don't want to remove this behavior from the modal, I want to have this enabled

Do you have any other solution?

Thanks for helping

keithluchtel commented 1 year ago

@Zakyyy, I hadn't looked any further into it since after I used this alternative in my project. Sorry I can't be more help.

Zakyyy commented 1 year ago

@Zakyyy, I hadn't looked any further into it since after I used this alternative in my project. Sorry I can't be more help.

No worries thanks

github-actions[bot] commented 1 year ago

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.

simon-abbott commented 1 year ago

Not fixed, don't close please.

Yassdrk commented 1 year ago

I have the same issue. Please help.

mobinni commented 1 year ago

Running into the same issue here

khadkamonsoon commented 1 year ago

Same problem .

khadkamonsoon commented 1 year ago

For now, I made margin of 2 and removed enableContentPanningGesture={false} such that user is allowed to navigate back to previous page and also have scroll function but still it is just a work around, I did such for a solution but couldn't find it.

github-actions[bot] commented 1 year ago

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.

simon-abbott commented 1 year ago

Not stale, please don't close.

github-actions[bot] commented 1 year ago

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.

simon-abbott commented 1 year ago

Still not fixed.

NicholasBoccuzzi commented 1 year ago

Hopping in here -- this is still an issue

Alsania14 commented 1 year ago

Help

ajimae commented 1 year ago

I am also experiencing this issue. Any solution to this?

For context, I am trying to achieve the instagram comment modal. When the modal opens up, the comments are scrollable, with the modal snapped at approximately half the screen but can be expanded when panning on the modal header/handle. Also when it's at the max height and the scrollview is at the top, any downwards drag on the scrollview will snap back the modal back to initial/original modal height.

I don't know if there is any other props combination or if anyone knows how this can achieve kindly comment here.

Thanks 🙏🏽

github-actions[bot] commented 11 months ago

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.

simon-abbott commented 11 months ago

Still broken, do not close.

github-actions[bot] commented 10 months ago

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.