about summary refs log tree commit diff
path: root/modules/bottom-sheet/ios
diff options
context:
space:
mode:
Diffstat (limited to 'modules/bottom-sheet/ios')
-rw-r--r--modules/bottom-sheet/ios/SheetView.swift7
-rw-r--r--modules/bottom-sheet/ios/SheetViewController.swift2
2 files changed, 6 insertions, 3 deletions
diff --git a/modules/bottom-sheet/ios/SheetView.swift b/modules/bottom-sheet/ios/SheetView.swift
index cf2019c6a..2223a5a8c 100644
--- a/modules/bottom-sheet/ios/SheetView.swift
+++ b/modules/bottom-sheet/ios/SheetView.swift
@@ -66,6 +66,7 @@ class SheetView: ExpoView, UISheetPresentationControllerDelegate {
       }
     }
   }
+  private var prevLayoutDetentIdentifier: UISheetPresentationController.Detent.Identifier?
 
   // MARK: - Lifecycle
 
@@ -143,11 +144,13 @@ class SheetView: ExpoView, UISheetPresentationControllerDelegate {
   }
 
   func updateLayout() {
-    if let contentHeight = self.innerView?.subviews.first?.frame.size.height {
+    if self.prevLayoutDetentIdentifier == self.selectedDetentIdentifier,
+       let contentHeight = self.innerView?.subviews.first?.frame.size.height {
       self.sheetVc?.updateDetents(contentHeight: self.clampHeight(contentHeight),
-                               preventExpansion: self.preventExpansion)
+                                  preventExpansion: self.preventExpansion)
       self.selectedDetentIdentifier = self.sheetVc?.getCurrentDetentIdentifier()
     }
+    self.prevLayoutDetentIdentifier = self.selectedDetentIdentifier
   }
 
   func dismiss() {
diff --git a/modules/bottom-sheet/ios/SheetViewController.swift b/modules/bottom-sheet/ios/SheetViewController.swift
index 56473b21c..7b6606980 100644
--- a/modules/bottom-sheet/ios/SheetViewController.swift
+++ b/modules/bottom-sheet/ios/SheetViewController.swift
@@ -62,7 +62,7 @@ class SheetViewController: UIViewController {
       }
     }
   }
-  
+
   func getCurrentDetentIdentifier() -> UISheetPresentationController.Detent.Identifier? {
     guard let sheet = self.sheetPresentationController else {
       return nil