[Bug]: Bottomsheet should be opened when screen loads but sometimes is not
Version
v5
Reanimated Version
v3
Gesture Handler Version
v2
Platforms
Android (Android Samsung A21S with android 11)
What happened?
In our application, the homepage features a bottom sheet that contains a section list. Upon accessing the homepage, the bottom sheet is expected to be opened. The bottom sheet on this page cannot be closed and operates with only two indexes.
Expected behavior:
However sometimes on specific devices of android the bottomsheet does not open at all :
What happens :
Reproduction steps
We replicated on device Android Samsung A21S with android 11.
Things that could be helpful mentioning:
Top and bottom snap points are calculated from screen dimensions.
export const useBottomSheetAnimation = (headerHeight: number) => {
const { height: frameHeight } = useSafeAreaFrame();
const insets = useSafeAreaInsets();
const bottomSnapPoints =frameHeight - headerHeight
const topSnapPoints = Dimensions.get("screen").height - insets.top;
const snapPoints = useMemo(
() => [bottomSnapPoints, topSnapPoints],
[bottomSnapPoints, topSnapPoints]
);
const animatedPosition = useSharedValue(bottomSnapPoints);
return {
snapPoints,
animatedPosition,
};
};
Bottom sheet only has those attributes
<BottomSheet
index={0}
enableDynamicSizing={false}
snapPoints={snapPoints}
handleIndicatorStyle={styles.handleIndicator}
enableOverDrag={false}
animatedPosition={animatedPosition}
>
<ListSection />
</BottomSheet>
Reproduction sample
https://snack.expo.dev/@healico/bottom-sheet---bottom-sheet-sometimes-not-opening-in-some-android
Relevant log output
No error are logged
I'm also facing this issue on Android devices.
facing same issue and on iOS too
Any news? Faced this error on Samsung A16 Android 14
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 is still happening
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.
Up
Enabling enableDynamicSizing and setting maxDynamicContentSize resolved a similar issue for me.
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.