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

[v4] | [v2] BottomSheetSectionList (and other scrollable elements) doesn't work on IOS

Open RomanSuvorov opened this issue 5 years ago • 10 comments

Bug

Environment info

Library Version
@gorhom/bottom-sheet ^4
react-native 0.63.3
react-native-reanimated ^2.0.0
react-native-gesture-handler ~1.10.2

Steps To Reproduce

  1. Check code below
  2. If you drag BottomSheet up, nothing happens.

Describe what you expected to happen:

  1. BottomSheetSectionList should work as expected

Reproducible sample code

      <BottomSheet
        snapPoints={snapPoints}
        content={() => (
          <BottomSheetSectionList
            alwaysBounceHorizontal={false}
            alwaysBounceVertical={false}
            bounce={false}
            bouncesZoom={false}
            showsVerticalScrollIndicator={false}
            sections={MOCK_DATA_ARRAY}
            keyExtractor={(item) => item.id}
            renderSectionHeader={({ section: { title } }) => (
              <View>
                <Text style={{ color: "white" }}>{title}</Text>
              </View>
            )}
            renderItem={({ item }) => <View><Text style={{ color: "white" }}>{item.title}</Text></View>}
          />
        )}
        enableOverDrag={true}
        setScrollEnabled={setScrollEnabled}
        bottomSheetRef={bottomSheetRef}
      />

https://user-images.githubusercontent.com/20489656/140971487-3bd019f3-a7e9-42d7-97bc-cd156ee32b5d.MP4

RomanSuvorov avatar Nov 09 '21 16:11 RomanSuvorov

All of scrollable components doesn't work on IOS(10-13 IPhone)

RomanSuvorov avatar Nov 10 '21 11:11 RomanSuvorov

Same for me. BottomSheetSectionList is not scrolling, when snapped to a point, Only scrolls when it is snapped to the final index (i.e. 90% or 100%). Tested both on android and iOS, it's the same issue.

Hope there will be a solution for this.

tusher-A avatar Nov 10 '21 13:11 tusher-A

Tested both on android and iOS, it's the same issue.

I have no problem with this lib on Android, all works perfectly. Only on IOS devices has this problem

RomanSuvorov avatar Nov 10 '21 13:11 RomanSuvorov

The way I solved my issue was, Using Flatlist from react-native-gesture-handler(This was also a suggestion on Troubleshooting page on react-native-bottom-sheet), and using the Flatlist in such a way that it mimics the section list, that meaning, section headers are Flatlist item. Then there is no gesture conflicts and it works for my case. Can't say for sure it will help you though.

tusher-A avatar Nov 12 '21 09:11 tusher-A

The way I solved my issue was, Using Flatlist from react-native-gesture-handler(This was also a suggestion on Troubleshooting page on react-native-bottom-sheet), and using the Flatlist in such a way that it mimics the section list, that meaning, section headers are Flatlist item. Then there is no gesture conflicts and it works for my case. Can't say for sure it will help you though.

Tried your solution and it's working for scrolling well except that if i'm not on final snappoint, i can't scroll to the bottom (a part of the flatlist is out of screen). Did you face the same issue ?

Benjdeul avatar Dec 03 '21 17:12 Benjdeul

This appears to still be an issue, and no scrollable components provided by this library work.

alexanderblackh avatar Dec 30 '21 01:12 alexanderblackh

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 Jan 29 '22 09:01 github-actions[bot]

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

github-actions[bot] avatar Feb 03 '22 09:02 github-actions[bot]

I'm getting this same error. I can't scroll down in a BottomSheetFlatList on iOS on the first try... need a bunch of tries. (This is on simulator.)

jzxchiang1 avatar Feb 16 '22 20:02 jzxchiang1

Also running into this issue when using SectionList from this lib, but weirdly it breaks only when adding some list optimization props. I have 4.1.5 installed. @gorhom any ideas or anywhere we can help investigate?

zachgibson avatar Mar 02 '22 15:03 zachgibson