[v4] Dynamic height with FlatList not scrolling.
See original GitHub issueBug
When using the useBottomSheetDynamicSnapPoints
together with BottomSheetFlatList
, it’s not possible to scroll the list anymore.
Environment info
Library | Version |
---|---|
@gorhom/bottom-sheet | 4.0.3 |
react-native | 0.64.2 |
react-native-reanimated | 2.2.2 |
react-native-gesture-handler | 1.10.3 |
Steps To Reproduce
- add a
BottomSheet
with theanimatedSnapPoints
,animatedContentHeight
andanimatedHandleHeight
provided byuseBottomSheetDynamicSnapPoints
- set the
handleContentLayout
to the child - add a big enough list to overflow the screen
Describe what you expected to happen:
- it’s not possible to scroll anymore
Reproducible sample code
Here’s a Snack to reproduce: https://snack.expo.dev/@alexisloiselle/dynamic-height-with-flatlist-not-scrolling
Issue Analytics
- State:
- Created 2 years ago
- Reactions:23
- Comments:22 (1 by maintainers)
Top Results From Across the Web
FlatList not scrolling due to items not having a fixed height
I have noticed that my FlatList won't scroll unless I set a fixed height to my items being rendered. I do not want...
Read more >Dynamic height with FlatList not scrolling - Expo Snack
Dynamic height with FlatList not scrolling. Reproducible issue template for Bottom Sheet v4. Open with Expo Go. Open in editor ...
Read more >Display a List Using the FlatList Component in React Native
React Native's `FlatList` component renders list items that can be displayed on the screen, and has features like scrolling, header/footer ...
Read more >react native flatlist dynamic height, flatlist not scrolling to end, flatlist ...
The dynamic height will be managed by the ScollView parent. React Native FlatList with columns, Last item width. 4. flatlist with dynamic numColumns....
Read more >8 ways to optimize React native FlatList performance
If your list items have dynamic height then you won't be able to use this method. Try to modify your list items design...
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
Hello @alexisloiselle !
I had the same issue with
BottomSheetScrollView
.As a temporary solution you can use
BottomSheetScrollView
and changeheight
property forBottomSheetScrollView
usinguseAnimatedStyle
to constraint height ofBottomSheetScrollView
. Also, to prevent infinity loop forhandleContentLayout
you need to add additionalView
with onLayout handler asBottomSheetScrollView
child.Here is example:
dynamic snap points currently working only with views, there are still some work to get it working with scrollables