[v4] | [v2] Bottom Sheet can not be closed on SDK 45
Bug
I have installed the latest SDK version, which is SDK 45. On IOS everything works fine, on Android there is a bug. After user opens the bottom sheet, there is no way to close it. There is no error or warning in the console. Before upgrading to SDK 45 everything worked fine.
Environment info
| Library | Version |
|---|---|
| @gorhom/bottom-sheet | ^4.2.2 |
| react-native | 0.68.1 |
| react-native-reanimated | ~2.8.0 |
| react-native-gesture-handler | ^2.2.0 |
Steps To Reproduce
1.I have installed the latest SDK version, which is SDK 45. 2.On IOS everything works fine, on Android there is a bug. 3.On Android, after user opens the bottom sheet, there is no way to close it. 4.There is no error or warning in the console. Before upgrading to SDK 45 everything worked fine.
Describe what you expected to happen:
1.User should be able to close the bottom sheet on every OS
Reproducible sample code
Same issue is happening to me on Android Expo SDK 44
I can't confirm this. I can close ModalBottomSheet and normal BottomSheets, with panning, background tap, dismiss and ref functions.
Hi, I'm having same issue just on Android SDK 45. Any solution?
I don't think there is an issue in the lib. I encountered the same issue on one project and react-native-gesture-handler was not correctly installed : see https://docs.swmansion.com/react-native-gesture-handler/docs/installation
After adding GestureHandlerRootView, everything works as expected on android
I don't think there is an issue in the lib. I encountered the same issue on one project and
react-native-gesture-handlerwas not correctly installed : see https://docs.swmansion.com/react-native-gesture-handler/docs/installationAfter adding
GestureHandlerRootView, everything works as expected on android
Exactly! This was the missing line that stopped it from closing responding to closing gestures. Thank you @mlecoq and everyone else 😁
Lol so the answer is RTFM? Sorry to waste y'alls time... Thanks @mlecoq 💥
I think I'll provide a PR to the docs to clear this one out. Still a lot of people that did not migrate to GestureHandlerRootView after upgrading RNGH.
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.
I don't think there is an issue in the lib. I encountered the same issue on one project and
react-native-gesture-handlerwas not correctly installed : see https://docs.swmansion.com/react-native-gesture-handler/docs/installationAfter adding
GestureHandlerRootView, everything works as expected on android
This worked for me. Thank you! I have wrapped my application like this: <GestureHandlerRootView style={{ flex: 1 }}> ...
It fixed it for me too :) Would be good to add this to the documentation.
It's in the documentation
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.
This is a lifesaver. The biggest head-scratcher for Android, because it worked flawlessly without this on iOS. I'm commenting simply so I have a history of this if I ever run into this in the future 😂