Skip to content

[v4] enableDynamicSizing does not work #1704

Open
@mstaniewski

Description

Bug

I need bottom sheet modals to adjust to its content height. I have found enableDynamicSizing prop in documentation and a pull request regarding dynamic sizing:
#1513

I have checked the example on how to use it here:

https://github.com/gorhom/react-native-bottom-sheet/pull/1513/files#diff-3f9ab4750993038cd43946db156ced8ad2138a75159f43862a3906e0747af3e7R52

Unfortunately bottom sheet height is not calculated properly. First modal appears good because it has snap points set. Second is displaying like content would be of height 0

Screen.Recording.2024-01-23.at.23.32.06.mov

Environment info

"@gorhom/bottom-sheet": "^4.6.0",
"react-native": "^0.73.2",

Library Version
@gorhom/bottom-sheet 4.6.0
react-native 0.73.2
react-native-reanimated 3.6.1
react-native-gesture-handler 2.14.0

Steps To Reproduce

Import BottomSheetModal from module, use it as presented in example and docs. Content height is not calculated

Describe what you expected to happen:

Modal appears with height adjusted to its content

Reproducible sample code

<BottomSheetModal ref={ref} enableDynamicSizing>
  <BottomSheetView>
    <View style={{height: 200, backgroundColor: 'black'}} />
  </BottomSheetView>
</BottomSheetModal>

Metadata

Assignees

Labels

bugSomething isn't workingv4Written in Reanimated v2v5

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions