react-native-bottom-sheet: [v4] [v2] BottomSheetScrollView does not scroll to bottom occasionally.
Bug
BottomSheetScrollView does not scroll to end occasionally. As far as the pattern I observed it does it when you drag it up slowly to the second snapPoint and then to third, then when you scroll it, it doesn’t scroll to bottom. But after mount if you drag it quickly, directly to last or third snapPoint it scrolls to bottom just fine.
Environment info
| Library | Version |
|---|---|
| @gorhom/bottom-sheet | 4.4.7 |
| react-native | 0.72.1 |
| react-native-reanimated | 3.4.2 |
| react-native-gesture-handler | 2.12.0 |
Steps To Reproduce
1.A simple BottomSheet with BottomSheetScrollView inside it. 2. With static snapPoints : const snapPoints = useMemo(() => [‘60%’, ‘88%’, ‘100%’], []); 3. Drag the BottomSheet slowly upwards, the BottomSheetScrollView will get stuck at a certain height.
Describe what you expected to happen:
1.BottomSheetScrollView should always scroll to the bottom of the content
<BottomSheet
ref={bottomSheetRef}
snapPoints={snapPoints}
index={0}
handleComponent={() => null}
onChange={handleSheetChanges}
backgroundComponent={props => <BottomSheetBackground {...props} />}
handleIndicatorStyle={{
backgroundColor: 'rgba(235, 236, 240, 1)',
}}>
<BottomSheetScrollView
showsVerticalScrollIndicator={false}
style={{ zIndex: 1, flex: 1 }}
>
<Pressable>
{props.children}
</Pressable>
<BottomSheetScrollView>
</BottomSheet>
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 3
- Comments: 21 (1 by maintainers)
For anyone stumbling across this: I fixed it by removing a view with flex: 1 that was the direct descendant of the sheet and the parent of the bottomsheetscrollview, so there is nothing in between the sheet and the scroll view. I don’t know what the problem was, but its’ working reliably now 😃
I am having the same issues in Android, but it is working perfectly fine on iOS devices. Sometimes bottomSheetScrollView gets stuck and does not allow me to scroll Then I have to reload the whole application again and it works.
@ils-anwarshah yeah this bug is only on android. But we don’t have to reload the app to make it go. Just go back to the previous screen and its gone.
Issue is fixed in version 4.5.1
I have uploaded the code into this repo please check
@ibraheem88 @ils-anwarshah could you provide repo example using this template https://snack.expo.io/@gorhom/bottom-sheet-v4-reproducible-issue-template
I noticed this same behavior when using ScrollView from react-native-gesture-handler. When using BottomSheetScrollView I noticed that it wouldn’t scroll to the bottom unless I disabled enableDynamicSizing and added snap points manually.
+1
yes still exist
@ibraheem88 @gorhom I think it is working fine after updating the library to the latest version…
Can’t seem to figure out what is causing it to get stuck at a certain height, also it is scrollable up but not down. Maybe the libraries like reanimated or gesture handler have been causing the issue.
@fjmorant Sadly i tried even older versions but the error was still there. Hope it gets fixed soon.
Thanks for the reply. But this is the major bug for Android users I have created the bottom sheet at the homepage of my Application. so there is no previous screen after login to go back. once the user logs In successfully, it will land on the homepage automatically until the user logs out. that is why I need to reload the whole application. please share the solution if you find any.