question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

scroll down to close bottom sheet in scrollview doesnt work in ios

See original GitHub issue

Bug

Hello I have a simple problem but can not handle it.

const data = useMemo(
    () =>
      Array(50)
        .fill(0)
        .map((_, index) => index),
    []
  );

  // render
  const renderItem = useCallback(
    (item) => (
      <View key={item}>
        <Text>{item}</Text>
      </View>
    ),
    []
  );
<BottomSheet
          ref={bottomSheetRef}
          index={0}
          snapPoints={snapPoints}
          onChange={handleSheetChanges}
          style={styles.sheetContainer}
        >
          <BottomSheetScrollView>{data.map(renderItem)}</BottomSheetScrollView>
        </BottomSheet>

this is how my codes look like.

Environment info

Library Version
@gorhom/bottom-sheet 2.2.2
react-native 0.63.2
react-native-reanimated 1.13.2
react-native-gesture-handler 1.7.0

Steps To Reproduce

  1. i open bottomsheet with a button
  2. scroll the view inside.
  3. scroll down to the top of contents and trying to keep scrolling down so that bottom sheet can be scrolled down and closed
  4. but bottom sheet is not scrolled down in ios. in android it works

Describe what you expected to happen:

  1. i want bottom sheet can be closed with scrolling down in ios too

Reproducible sample code

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:2
  • Comments:8

github_iconTop GitHub Comments

1reaction
carissackscommented, Jun 2, 2021

Hi @casysj @moseffect21 , try adding 0 to your snapPoint. Looks something like this

const snapPoints = [0, '50%', '100%'];

hope it works well Related PR: #322

0reactions
BerkeArascommented, May 28, 2022

Any updates?

Read more comments on GitHub >

github_iconTop Results From Across the Web

UIScrollView not scrolling - ios - Stack Overflow
You need to set the contentSize property of the scroll view in order for it to scroll properly.
Read more >
Troubleshooting | React Native Bottom Sheet - GitHub Pages
To resolve this issue, please use ScrollView & FlatList from react-native-gesture-handler provide instead react-native . import { ScrollView,
Read more >
iOS 15 'Drag to Dismiss' Regression | Apple Developer Forums
Not sure I completely follow this suggestion, but if you begin dragging from a region outside the scroll view, the modal gesture does...
Read more >
gorhom/bottom-sheet - npm
Seamless keyboard handling for iOS & Android. Support pull to refresh for scrollables. Support FlatList, SectionList, ScrollView & View ...
Read more >
Scrollable Bottom Sheet with virtualisation, native animations ...
The library you linked is great for bottom sheets that don't need to render lists, otherwise you'll experience performance problems if you ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found