From 863d727f67e057298e97fd462c9b6d1b1ed4988d Mon Sep 17 00:00:00 2001 From: Hailey Date: Sun, 6 Oct 2024 11:19:35 -0700 Subject: [PATCH 1/2] fix bounce ios --- modules/bottom-sheet/ios/SheetView.swift | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/modules/bottom-sheet/ios/SheetView.swift b/modules/bottom-sheet/ios/SheetView.swift index cf2019c6a1..2223a5a8ca 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() { From 793ede747ddd5e065056df81a904a41cd652296c Mon Sep 17 00:00:00 2001 From: Hailey Date: Sun, 6 Oct 2024 11:47:08 -0700 Subject: [PATCH 2/2] lint --- modules/bottom-sheet/ios/SheetViewController.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/bottom-sheet/ios/SheetViewController.swift b/modules/bottom-sheet/ios/SheetViewController.swift index 56473b21cd..7b6606980d 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