You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When enableFreeze(true) from react-native-screens is enabled, BottomSheetFlatList gestures stop behaving correctly after navigating away from the tab containing the bottom sheet and then returning to it. The tabs are rendered using @react-navigation/bottom-tabs.
The bottom sheet initially works as expected when the app first launches. I can drag the sheet up and down by starting the gesture on the BottomSheetFlatList area.
However, after switching to another tab and then returning to the tab with the bottom sheet, gestures that start on the BottomSheetFlatList no longer drag the bottom sheet. The sheet can only be moved by dragging the handle.
If I drag the sheet to the highest snap point using the handle, the flat list becomes scrollable. But when I drag the sheet back down to a lower snap point, the list area stops responding correctly again and cannot be used to drag the sheet.
This only happens when enableFreeze(true) is enabled. Without enableFreeze(true), the bottom sheet and BottomSheetFlatList gestures work as expected after switching tabs.
bug.mov
Reproduction steps
Create a React Native app with React Navigation native stack, React Navigation bottom tabs, react-native-screens, react-native-gesture-handler, react-native-reanimated, and @gorhom/bottom-sheet.
Call enableFreeze(true) from react-native-screens.
Render a native stack navigator with a bottom tab navigator
Inside the bottom tab navigator, render two tab screens.
In the first tab screen, render a BottomSheet with a BottomSheetFlatList.
Launch the app.
On initial launch, drag the bottom sheet up and down by starting the gesture on the BottomSheetFlatList area. This works as expected.
Switch to the second tab.
Switch back to the first tab.
Try to drag the bottom sheet up or down again by starting the gesture on the BottomSheetFlatList area.
Notice that the bottom sheet no longer moves from gestures started on the list area. It can only be moved using the handle.
Drag the bottom sheet to the highest snap point using the handle.
Notice that the BottomSheetFlatList can now scroll.
Drag the bottom sheet back down to a lower snap point.
Notice that the list area stops responding correctly again and cannot be used to drag the bottom sheet.
Version
v5
Reanimated Version
v3
Gesture Handler Version
v2
Platforms
iOS, Android
What happened?
When
enableFreeze(true)fromreact-native-screensis enabled,BottomSheetFlatListgestures stop behaving correctly after navigating away from the tab containing the bottom sheet and then returning to it. The tabs are rendered using@react-navigation/bottom-tabs.The bottom sheet initially works as expected when the app first launches. I can drag the sheet up and down by starting the gesture on the
BottomSheetFlatListarea.However, after switching to another tab and then returning to the tab with the bottom sheet, gestures that start on the
BottomSheetFlatListno longer drag the bottom sheet. The sheet can only be moved by dragging the handle.If I drag the sheet to the highest snap point using the handle, the flat list becomes scrollable. But when I drag the sheet back down to a lower snap point, the list area stops responding correctly again and cannot be used to drag the sheet.
This only happens when
enableFreeze(true)is enabled. WithoutenableFreeze(true), the bottom sheet andBottomSheetFlatListgestures work as expected after switching tabs.bug.mov
Reproduction steps
react-native-screens,react-native-gesture-handler,react-native-reanimated, and@gorhom/bottom-sheet.enableFreeze(true)fromreact-native-screens.BottomSheetwith aBottomSheetFlatList.BottomSheetFlatListarea. This works as expected.BottomSheetFlatListarea.BottomSheetFlatListcan now scroll.Example:
Reproduction sample
https://snack.expo.dev/@gorhom/bottom-sheet---issue-reproduction-template
Relevant log output