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

[Bug]: Bottomsheet should be opened when screen loads but sometimes is not

Open L-Weisz opened this issue 11 months ago • 8 comments

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: Image

However sometimes on specific devices of android the bottomsheet does not open at all : What happens : Image

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

L-Weisz avatar Jan 17 '25 10:01 L-Weisz

I'm also facing this issue on Android devices.

sabuhiteymurov avatar Feb 13 '25 12:02 sabuhiteymurov

facing same issue and on iOS too

fjmorant avatar Mar 03 '25 13:03 fjmorant

Any news? Faced this error on Samsung A16 Android 14

sudo-viktor avatar Mar 12 '25 14:03 sudo-viktor

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 Apr 12 '25 09:04 github-actions[bot]

this is still happening

fjmorant avatar Apr 12 '25 13:04 fjmorant

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 May 13 '25 09:05 github-actions[bot]

Up

thiagoemanoel98 avatar May 18 '25 20:05 thiagoemanoel98

Enabling enableDynamicSizing and setting maxDynamicContentSize resolved a similar issue for me.

VladimirDyachenko avatar May 30 '25 08:05 VladimirDyachenko

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 Jun 29 '25 09:06 github-actions[bot]

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

github-actions[bot] avatar Jul 04 '25 09:07 github-actions[bot]