react-native-bottom-sheet icon indicating copy to clipboard operation
react-native-bottom-sheet copied to clipboard

[v4] | [v2] Issue when using contentInset={{top: x}}

Open relaxmeister opened this issue 3 years ago • 2 comments

Bug

Using contentInset={{top: x}} in and causing an initial "hack" of the same amount of x when scrolling

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

  1. 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:

  1. 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>

relaxmeister avatar May 21 '23 08:05 relaxmeister

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.

github-actions[bot] avatar Jun 20 '23 09:06 github-actions[bot]

This issue was closed because it has been stalled for 5 days with no activity.

github-actions[bot] avatar Jun 25 '23 09:06 github-actions[bot]