react-native-bottom-sheet
react-native-bottom-sheet copied to clipboard
[v4] | [v2] Issue when using contentInset={{top: x}}
Bug
Using contentInset={{top: x}} in
Environment info
| Library | Version |
|---|---|
| @gorhom/bottom-sheet | "^4" |
| react-native | "0.68.2" |
| react-native-reanimated | "^2.9.1" |
| react-native-gesture-handler | "^2.4.2" |
Steps To Reproduce
- Straight forward implementation and the issue is using contentInset={{top: x}} which I use to get a certain effect on my custom header
Describe what you expected to happen:
- The bottom sheet shouldn't hack down x amount on initial scroll but remain smooth as expected
Reproducible sample code
const snapPoints = useMemo(() => ["80%"], []);
<BottomSheetModal
snapPoints={snapPoints}
ref={modalRef}
index={0}
backdropComponent={renderBackdrop}
handleComponent={renderHeaderHandle}
style={{ flex: 1 }}
>
<BottomSheetScrollView
contentInset={{ top: 58 }} // <-- this is the important part
>
{array.map((e) => (
<SortingDetail item={e} onPress={() => console.log("lol")} />
))}
</BottomSheetScrollView>
</BottomSheetModal>
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.