Bottom Sheet Modal overlay not working when using one snap point
Bug
Hello,
I use Bottom Sheet Modal, and want to use one Snap Point, it works but I dont get an overlay, if I use 2 snapPoints then its work. How can I fix it ?
Environment info
| Library | Version |
|---|---|
| @gorhom/bottom-sheet | x.x.x |
| expo | 45.0 |
| react-native-reanimated | 2.9.1 |
| react-native-gesture-handler | 2.2.1 |
Steps To Reproduce
Reproducible sample code
const snapPoints = useMemo(() => ['75%'], []);
....
return (
<BottomSheetModal
ref={ref}
index={0}
snapPoints={snapPoints}
handleIndicatorStyle={s.handleStyle}
onChange={handleChange}
backdropComponent={BottomSheetBackdrop}
>
{
renderTabBar
}
{ datas && datas.length > 0 ? (
<BottomSheetFlatList
data={datas}
renderItem={renderItem}
keyExtractor={(item, i) => i.toString()}
initialNumToRender={10}
windowSize={8}
maxToRenderPerBatch={50}
updateCellsBatchingPeriod={50}
contentContainerStyle={s.flatlistContent}
/>
)
:
null
}
</BottomSheetModal>
)
You need to set the index prop to index={0} on the BottomSheetModal.
You need to set the index prop to index={0} on the BottomSheetModal.
The Index prop is 0
use preset() and dismiss() methods to show and hide modal, Its working fine for me .
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.
Leaving a comment here if anyone looking for a solution.
Both disappearsOnIndex and appearsOnIndex must be set:
<BottomSheetBackdrop {...props} disappearsOnIndex={-1} appearsOnIndex={0} />