ensure self.maxHeight is set
This commit is contained in:
@@ -73,7 +73,7 @@ class SheetView: ExpoView, UISheetPresentationControllerDelegate {
|
|||||||
|
|
||||||
required init (appContext: AppContext? = nil) {
|
required init (appContext: AppContext? = nil) {
|
||||||
super.init(appContext: appContext)
|
super.init(appContext: appContext)
|
||||||
self.maxHeight = Util.getScreenHeight()
|
self.maxHeight = Util.getScreenHeight() ?? UIScreen.main.bounds.height
|
||||||
self.touchHandler = RCTTouchHandler(bridge: appContext?.reactBridge)
|
self.touchHandler = RCTTouchHandler(bridge: appContext?.reactBridge)
|
||||||
SheetManager.shared.add(self)
|
SheetManager.shared.add(self)
|
||||||
}
|
}
|
||||||
@@ -126,6 +126,10 @@ class SheetView: ExpoView, UISheetPresentationControllerDelegate {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if let screenHeight = Util.getScreenHeight() {
|
||||||
|
self.maxHeight = screenHeight
|
||||||
|
}
|
||||||
|
|
||||||
let sheetVc = SheetViewController()
|
let sheetVc = SheetViewController()
|
||||||
sheetVc.setDetents(contentHeight: self.clampHeight(contentHeight), preventExpansion: self.preventExpansion)
|
sheetVc.setDetents(contentHeight: self.clampHeight(contentHeight), preventExpansion: self.preventExpansion)
|
||||||
if let sheet = sheetVc.sheetPresentationController {
|
if let sheet = sheetVc.sheetPresentationController {
|
||||||
|
|||||||
Reference in New Issue
Block a user