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

[Bug]: BottomSheetFlatList items not scroll with bottomSheetView v5.1.4

Open Ankitinara opened this issue 2 months ago • 15 comments

Version

v5

Reanimated Version

v3

Gesture Handler Version

v2

Platforms

iOS, Android

What happened?

When I try to scroll through a list inside a BottomSheetFlatList (wrapped within a BottomSheetView), the list does not scroll — the content remains static.

However, when I downgrade the library version to 4.6.4, the scrolling works as expected. This issue only occurs in newer versions of the @gorhom/bottom-sheet package.

Reproduction steps

  • Wraps everything in a BottomSheetModalProvider

Uses a BottomSheetModal

Contains a BottomSheetView

Inside that view is a BottomSheetFlatList that fails to scroll in versions after 4.6.4, but works fine in 4.6.4.

i Atttached the image in this list not scroll.

Image

Reproduction sample

https://gorhom.dev/react-native-bottom-sheet/components/bottomsheetflatlist

Relevant log output


Ankitinara avatar Oct 24 '25 14:10 Ankitinara

When I add this item to the bottom sheet list, the list does not scroll; only the visible items are displayed.

Ankitinara avatar Oct 27 '25 06:10 Ankitinara

Same issue happened with me , scroll was working perfectly fine with 4.6.4 but not with ^5 @gorhom

NikhilCodeblaze avatar Oct 27 '25 11:10 NikhilCodeblaze

I am having the same problem.

bledar avatar Oct 27 '25 16:10 bledar

I am having the same problem here

riley-wv avatar Oct 28 '25 02:10 riley-wv

The same problem happened with BottomSheetScrollView too, but it works when i set the height of the style props of the BottomSheetScrollView to 0

Selsinee avatar Oct 28 '25 11:10 Selsinee

I was able to make it work by making following changes:

  • Downgrading to version ^5.2.0
  • Disabling dynamic sizing enableDynamicSizing={false}
  • Removing maxDynamicContentSize prop
  • Using Flatlist with scrollComponent from useBottomSheetScrollableCreator hook.

Example:

const BottomSheetListScrollable = useBottomSheetScrollableCreator();


<BottomSheet
  ref={bottomSheetRef}
  enablePanDownToClose
  enableDynamicSizing={false}
  enableOverDrag
  index={-1}
  backdropComponent={BottomSheetBackdrop}
>
  <BottomSheetView>
    <FlatList
      renderItem={renderItem}
      contentContainerStyle={styles.optionsContainer}
      data={renderedOptions}
      renderScrollComponent={BottomSheetListScrollable}
    />
  </BottomSheetView>
</BottomSheet>

bledar avatar Oct 28 '25 16:10 bledar

I tried everything, I can't make anything to scroll inside a BottomSheet

hlspablo avatar Oct 29 '25 22:10 hlspablo

When I remove the bottomSheetView in BottomsheetFlatlist, the scroll works. However, when I add the bottomSheetView, the scroll does not function. (in v5.1.4)

Ankitinara avatar Oct 30 '25 03:10 Ankitinara

<BottomSheetFlatList
       data={filteredData}
       ref={flatListRef}
       keyExtractor={(item, index) => index.toString()}
       renderItem={renderItem}
       showsVerticalScrollIndicator={false}
       getItemLayout={(data, index) => ({
         length: 50, // Match item height
         offset: 50 * index,
         index,
       })}
       onScrollToIndexFailed={onScrollToIndexFailed}
       onLayout={() => {
         if (!flatListRef.current || !defaultSelected) return;

         const index = filteredData.findIndex(
           item =>
             (typeof item === 'object' ? item.value : item) ===
             defaultSelected,
         );

         if (index !== -1) {
           flatListRef.current.scrollToIndex({
             index,
             animated: true,
             viewPosition: 0.5,
           });
         }
       }}
     />

i have this code in which scrollToIndex stopped working after upgrading to 5.2.6 from 4.6.4

NikhilCodeblaze avatar Oct 30 '25 07:10 NikhilCodeblaze

I'm also having this same problem with the BottomSheetModal. The contents of the BottomSheetFlatList will not scroll when wrapped inside of a BottomSheetView component.

<BottomSheetModal>
  <BottomSheetView>
    <BottomSheetFlatList>
      {...props}
    </BottomSheetFlatList>
  </BottomSheetView>
</BottomSheetModal>

dankeykang674 avatar Nov 14 '25 17:11 dankeykang674

<BottomSheetFlatList
       data={filteredData}
       ref={flatListRef}
       keyExtractor={(item, index) => index.toString()}
       renderItem={renderItem}
       showsVerticalScrollIndicator={false}
       getItemLayout={(data, index) => ({
         length: 50, // Match item height
         offset: 50 * index,
         index,
       })}
       onScrollToIndexFailed={onScrollToIndexFailed}
       onLayout={() => {
         if (!flatListRef.current || !defaultSelected) return;

         const index = filteredData.findIndex(
           item =>
             (typeof item === 'object' ? item.value : item) ===
             defaultSelected,
         );

         if (index !== -1) {
           flatListRef.current.scrollToIndex({
             index,
             animated: true,
             viewPosition: 0.5,
           });
         }
       }}
     />

i have this code in which scrollToIndex stopped working after upgrading to 5.2.6 from 4.6.4

@gorhom Can you help us out we kind stuck here, scrollToIndex was working very well but after upgrading its not working

NikhilCodeblaze avatar Nov 19 '25 02:11 NikhilCodeblaze

@gorhom any update on this? kinda stuck with scrolling issue on a deployed app.

HumayounBaig avatar Nov 20 '25 07:11 HumayounBaig

the same thing for me, do not know how to scroll inside the bottom sheet

JustynaKK avatar Nov 20 '25 13:11 JustynaKK

I'm also having this same problem with the BottomSheetModal. The contents of the BottomSheetFlatList will not scroll when wrapped inside of a BottomSheetView component.

{...props}

I think it is not an issue because I have such a hierarchy and scroll works fine.

<BottomSheet>
   <BottomSheetView>
       <TouchableWithoutFeedback>
          <>
              <BottomSheetFlatList />
               ....
          <>

I believe the issue occurs when some container is added for <BottomSheetView>

This Code did not work

<BottomSheet>
   <TouchableWithoutFeedback>
      <BottomSheetView>
          <>
              <BottomSheetFlatList />
               ....
          <>

devloop11 avatar Nov 27 '25 11:11 devloop11

Same :| Wondering if we have to switch to https://github.com/lodev09/react-native-true-sheet ?

kristian-nst avatar Dec 03 '25 13:12 kristian-nst