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

Cant close bottomsheet

Open Madeean opened this issue 11 months ago • 2 comments

hi, I can't close the bottomsheet using the button I created, here is the code and link video. Is there any other way? video: https://drive.google.com/file/d/1tqYglGS4AKyYLESECVKWwJQV6Iv8m4Eu/view?usp=sharing

code:

export const Test = () => {
  const bottomSheet = useRef<BottomSheetMethods>(null);
  return (
    <GestureHandlerRootView
      style={{
        flex: 1,
        backgroundColor: '#fff',
      }}>
      <TouchableOpacity onPress={() => bottomSheet.current?.open()}>
        <Text>open bottomsheet</Text>
      </TouchableOpacity>
      <BottomSheet ref={bottomSheet} height={500}>
        <View>
          <TouchableOpacity
            style={{
              width: 200,
              height: 200,
            }}
            onPress={() => {
              console.log('close');
              bottomSheet.current?.close();
            }}>
            <Text>close bottomsheet</Text>
          </TouchableOpacity>
        </View>
      </BottomSheet>
    </GestureHandlerRootView>
  );
};

Madeean avatar Jan 12 '25 09:01 Madeean

No, what you have should work fine. I'll do a quick repro soon to check it out.

Thanks for reporting @Madeean also can you check if dragging the sheet down closes it

stanleyugwu avatar Jan 13 '25 15:01 stanleyugwu

it's normal when you click out of bottomsheet or drag down the bottomsheet

i use this version "react": "18.3.1", "react-native": "0.76.5",

when I enable newArchEnabled in gradle.properties, it happens, but when I disable it, it runs normally.

Madeean avatar Jan 14 '25 07:01 Madeean