[v4] | [v2] Initial Closed State with index prop not working properly...
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
- Create bottomsheet as documents show you to do.
- set only 1 snap point lets say 50%
- set index prop on the bottomsheet element to close bottomsheet initially
Describe what you expected to happen:
- bottomsheet comes closed initially...
- but you can not expand it
Steps To Reproduce - Situation 2
- Create bottomsheet as documents show you to do.
- set 2 snap point lets say 50% and 75%
- set index prop on the bottomsheet element to close bottomsheet initially
Describe what you expected to happen:
- bottomsheet comes closed initially...
- but when you first expand the bottomsheet it goes up and closes...
- on the other presses it works normal... just the first click it comes up and goes down...
@pdesign: hello! :wave:
This issue is being automatically closed because it does not follow the issue template.
Same issue here. This issue happens only on iOS for me. Android and Web works fine.
@pdesign why not just submitting a expo snack to help me debug it faster :(
@pdesign why not just submitting a expo snack to help me debug it faster :(
will add a code example here tomorrow
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>
I updated it to 5.0.2, and the bug has been fixed
can confirm, updating the lib to v5.0.2 solved this issue
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.