Scrolling content makes the bottomsheet close / snap
See original GitHub issueBug
I add a BottomSheet
with the snapPoints [20, “50%”, “90%”]. Then wrap my content in BottomSheetScrollView
.
I expand the BottomSheet to 90% scroll the content, but when I start to scroll the content back to top the BottomSheet “closes” or snaps to closest point (it looks like.)
I was able to reproduce this in both my own code and in the example for ScrollView. I’m not sure, but it looks like it only happens if you drag the content for a longer distance, not “short” scrolls.
It happens on Android and iOS.
https://user-images.githubusercontent.com/1405227/105365539-a8fe7000-5bfe-11eb-82af-5b57be194648.mov
Environment info
In my app:
Library | Version |
---|---|
@gorhom/bottom-sheet | 2.0.4 |
react-native | 0.63.4 |
react-native-reanimated | 1.13.0 |
react-native-gesture-handler | 1.9.0 |
From example-app in repo:
Library | Version |
---|---|
@gorhom/bottom-sheet | 2.0.4 |
react-native | 0.63.4 |
react-native-reanimated | 1.13.2 |
react-native-gesture-handler | 1.9.0 |
Steps To Reproduce
- Run code or use ScrollView-example
- Expand BottomSheet
- Scroll content
- Scroll back up in a single drag-event
Reproducible sample code
import React from 'react'
import { View } from 'react-native'
import BottomSheet, {
BottomSheetScrollView,
} from '@gorhom/bottom-sheet'
const C = () => {
return (
<View style={{ flex: 1 }}>
<BottomSheet snapPoints={[20, '50%', '90%']} index={1}>
<BottomSheetScrollView>
<View style={{ flex: 1 }}>
{Array(50)
.fill('x')
.map((_, i) => {
return (
<View
key={String(i)}
style={{
marginBottom: 40,
backgroundColor: '#cecece',
height: 60,
}}
/>
)
})}
</View>
</BottomSheetScrollView>
</BottomSheet>
</View>
)
}
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Scroll through Flutter Bottom Sheet - Stack Overflow
I have a Column with a list of ListTile s as the content of the bottom sheet. My problem is that if I...
Read more >Scrollables | React Native Bottom Sheet - GitHub Pages
Scrollables. This library provides a pre-integrated virtualized lists that utilize an internal functionalities with the bottom sheet container to allow ...
Read more >Flutter Tutorial - Snapping Modal Bottom Sheet ... - YouTube
Create a snapping modal bottom sheet in Flutter that snaps to different positions. This Flutter snapping sheet is also scrollable, ...
Read more >snapping_sheet | Flutter Package - Pub.dev
In order to make the sheet know about the scroll controller, you need to provide it in the SnappingSheetContent class (See example below)....
Read more >Sheets: bottom - Material Design
BottomSheetBehavior is applied to a child of CoordinatorLayout to make that child a persistent bottom sheet, which is a view that comes up...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@sandan10 i have checked the codebase , there is no left over debugging logs.
please check again and let me know… thanks for the coffee 😇
Thanks, looks like the scrolling is working now!
It also seems like there is some debug-logging going on when scrolling. Snippet of output: