ensure self.maxHeight is set

This commit is contained in:
Samuel Newman
2025-11-20 15:50:04 +02:00
parent 2faf62c7f7
commit d91925f422
+5 -1
View File
@@ -73,7 +73,7 @@ class SheetView: ExpoView, UISheetPresentationControllerDelegate {
required init (appContext: AppContext? = nil) {
super.init(appContext: appContext)
self.maxHeight = Util.getScreenHeight()
self.maxHeight = Util.getScreenHeight() ?? UIScreen.main.bounds.height
self.touchHandler = RCTTouchHandler(bridge: appContext?.reactBridge)
SheetManager.shared.add(self)
}
@@ -126,6 +126,10 @@ class SheetView: ExpoView, UISheetPresentationControllerDelegate {
return
}
if let screenHeight = Util.getScreenHeight() {
self.maxHeight = screenHeight
}
let sheetVc = SheetViewController()
sheetVc.setDetents(contentHeight: self.clampHeight(contentHeight), preventExpansion: self.preventExpansion)
if let sheet = sheetVc.sheetPresentationController {