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

[v5] BottomSheet does not work since 5.0.0-alpha.5 if no scrollable component is used

Open hoangvvo opened this issue 1 year ago • 1 comments

Bug

Since https://github.com/gorhom/react-native-bottom-sheet/pull/1513/files, if no "scrollable component" is used inside the bottom sheet, the bottom sheet does not work. After adding console.log in various parts of the lib, I understand the way it works in alpha.5 is that animatedContentHeight.value must be set here for bottom sheet to work. Otherwise, we always run into an early return here.

image image

I tested another cases where I used one of the scrollable components (eg. BottomSheetScrollView) and it worked.

It is not clear to me if this is a bug or it is that the new version requires the use of a scrollable component to work properly (if that is the case then the doc needs to be updated)

Environment info

Library Version
@gorhom/bottom-sheet x.x.x
react-native x.x.x
react-native-reanimated x.x.x
react-native-gesture-handler x.x.x

Steps To Reproduce

  1. Just use the example code from https://ui.gorhom.dev/components/bottom-sheet/usage

Describe what you expected to happen:

  1. After expanding the bottom sheet, it should show to bottom sheet. However the bottom sheet is not visible.

Reproducible sample code

https://ui.gorhom.dev/components/bottom-sheet/usage

hoangvvo avatar Feb 14 '24 08:02 hoangvvo

@hoangvvo for me it was enough to wrap my content with a <BottomSheetView> and it started working again. Not sure I fully understand exactly why but just wanted to let you know.

kimf avatar Feb 20 '24 15:02 kimf

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 Mar 22 '24 09:03 github-actions[bot]

This issue was closed because it has been stalled for 5 days with no activity.

github-actions[bot] avatar Mar 28 '24 09:03 github-actions[bot]