question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

BottomSheetScrollView cannot scroll when used with Dynamic Snap Point

See original GitHub issue

Bug

It seems BottomSheetScrollView cannot be used with dynamic snap points. it’s necessary in a case where the content of the bottom sheet can be small and can be larger than the bottom sheet’s maximum height.

Environment info

Library Version
@gorhom/bottom-sheet v4.0.0-alpha.13
react-native 0.64.1
react-native-reanimated 2.1.0
react-native-gesture-handler 1.10.3

Steps To Reproduce

Use /example/src/screens/modal/DynamicSnapPointExample.tsx

  1. Change the code BottomSheetView to BottomSheetScrollView
  2. Press Yes button several times.
  3. The scroll view cannot scroll.

https://user-images.githubusercontent.com/8144911/122670411-e5111d80-d1fc-11eb-8be6-49c50d95411a.mov

Describe what you expected to happen:

  1. The content can be scrolled when the content height is bigger than the bottom-sheet’s rendered area.

Reproducible sample code

The example code is used.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:3
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

3reactions
gorhomcommented, Jun 22, 2021

@tsugitta this is an expected behaviour, the react native scroll view expect a height or flex: 1 to be able to scroll its content. in your case the content size stretched the BottomSheetScrollView height too.

i would advice to give the BottomSheetScrollView the initial measured content height, then let it be fixed, and content can grow and be scrollable 👏

0reactions
SMhdAsadicommented, Aug 23, 2022

Try using maxHeight style on BottomSheetScrollView.

<BottomSheetScrollView
    onLayout={handleContentLayout}
    style={{
        maxHeight: Dimensions.get('window').height,
    }}
>
        ...
</BottomSheetScrollView>
Read more comments on GitHub >

github_iconTop Results From Across the Web

[v3] BottomSheetScrollView not working with dynamic ... - GitHub
Bug. Any dynamic snapPoint change not working with BottomSheetScrollView , During scrolling BottomSheetModal disappears immediately. Environment ...
Read more >
android - React Native - Reanimated Bottom Sheet: Content in ...
On Android only either the scrolling worked or the snap points. Never the two (Only the two-finger pinching). Can't scroll Flatlist inside react ......
Read more >
How to add Snap to alignment feature in FlatList in React Native
Users can start scrolling at any time and can stop scrolling at any time. This type of FlatList doesn't have any restrictions.
Read more >
BottomSheetScrollView | React Native Bottom Sheet
This needed when bottom sheet used with multiple scrollables to allow bottom sheet detect the current scrollable ref, especially when used with React ......
Read more >
React Native scrollToIndex - Dynamic size item scroll inside ...
In this video tutorial you will learn about React Native scrollToIndex and how to scroll to an item inside a FlatList, ListView, ScrollView, ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found