react-native-bottom-sheet
react-native-bottom-sheet copied to clipboard
[v5] BottomSheet does not work since 5.0.0-alpha.5 if no scrollable component is used
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.
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
- Just use the example code from https://ui.gorhom.dev/components/bottom-sheet/usage
Describe what you expected to happen:
- 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 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.
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.
This issue was closed because it has been stalled for 5 days with no activity.