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

[v4] | [v2] Initial Closed State with index prop not working properly... #1953

Open
pdesign opened this issue Sep 29, 2024 · 7 comments
Open
Labels

Comments

@pdesign
Copy link

pdesign commented Sep 29, 2024

Bug

Environment info

Library Version
@gorhom/bottom-sheet 5.0.0-alpha.11
react-native ^0.74.5
react-native-reanimated ~3.10.1
react-native-gesture-handler ~2.16.1

Steps To Reproduce - Situation 1

  1. Create bottomsheet as documents show you to do.
  2. set only 1 snap point lets say 50%
  3. set index prop on the bottomsheet element to close bottomsheet initially

Describe what you expected to happen:

  1. bottomsheet comes closed initially...
  2. but you can not expand it

Steps To Reproduce - Situation 2

  1. Create bottomsheet as documents show you to do.
  2. set 2 snap point lets say 50% and 75%
  3. set index prop on the bottomsheet element to close bottomsheet initially

Describe what you expected to happen:

  1. bottomsheet comes closed initially...
  2. but when you first expand the bottomsheet it goes up and closes...
  3. on the other presses it works normal... just the first click it comes up and goes down...
@pdesign pdesign added the bug Something isn't working label Sep 29, 2024
Copy link

@pdesign: hello! 👋

This issue is being automatically closed because it does not follow the issue template.

@hariom-nft
Copy link

Same issue here. This issue happens only on iOS for me. Android and Web works fine.

@gorhom gorhom self-assigned this Oct 2, 2024
@gorhom gorhom added the v5 label Oct 2, 2024
@gorhom
Copy link
Owner

gorhom commented Oct 2, 2024

@pdesign why not just submitting a expo snack to help me debug it faster :(

@gorhom gorhom removed their assignment Oct 2, 2024
@pdesign
Copy link
Author

pdesign commented Oct 10, 2024

@pdesign why not just submitting a expo snack to help me debug it faster :(

will add a code example here tomorrow

@AradSharafi
Copy link

AradSharafi commented Oct 14, 2024

Same issue here. I tried to submit a expo snack for you but unfortunately it gets stuck in connecting for me :(

Issue: BottomSheet won't open after setting the initial index on some Android devices

Description: When initializing the BottomSheet with index={-1}, the sheet no longer opens on certain Android devices. This behavior occurs inconsistently across different devices. For instance, it works fine on a Samsung Galaxy S23 but does not work on a Samsung Galaxy J5 Pro.

Dependencies:
@gorhom/bottom-sheet: 5.0.0-alpha.11
expo: ~51.0.36
react: 18.2.0,
react-native: ^0.75.4,

import MyBottomSheet, {BottomSheetView} from '@gorhom/bottom-sheet';

  const myRef = useRef<MyBottomSheet>(null);

  function open() {
    myRef.current?.collapse();
  }

  function close() {
    myRef.current?.close();
  }
  
  <View style={styles.screen}>
      <Button title='Open' onPress={open} />
      <Button title='Close' onPress={close} />

      <MyBottomSheet
        ref={myRef}
        index={-1}
        snapPoints={['50%', '90%']}
      >
        <BottomSheetView style={styles.contentContainer}>
          <Text vstyle={styles.text}>
            Awesome 🎉
          </Text>
        </BottomSheetView>
      </MyBottomSheet>
    </View>

@AradSharafi
Copy link

I updated it to 5.0.2, and the bug has been fixed

@farellsmma
Copy link

can confirm, updating the lib to v5.0.2 solved this issue

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

No branches or pull requests

5 participants