Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cant close bottomsheet #38

Open
Madeean opened this issue Jan 12, 2025 · 2 comments
Open

Cant close bottomsheet #38

Madeean opened this issue Jan 12, 2025 · 2 comments

Comments

@Madeean
Copy link

Madeean commented Jan 12, 2025

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>
  );
};
@stanleyugwu
Copy link
Owner

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

@Madeean
Copy link
Author

Madeean commented Jan 14, 2025

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants