From e1526f5a17136d17d6fdb799fb57f29571b9213f Mon Sep 17 00:00:00 2001 From: mikedinicolatt <124949028+mikedinicolatt@users.noreply.github.com> Date: Fri, 31 May 2024 13:02:13 -0400 Subject: [PATCH] Partial sheet panning fix (#163) --- .../Sheet/PartialSheetPresentationController.swift | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Sources/Thumbprint/Presentations/Sheet/PartialSheetPresentationController.swift b/Sources/Thumbprint/Presentations/Sheet/PartialSheetPresentationController.swift index 263d44c..e7f8a2e 100644 --- a/Sources/Thumbprint/Presentations/Sheet/PartialSheetPresentationController.swift +++ b/Sources/Thumbprint/Presentations/Sheet/PartialSheetPresentationController.swift @@ -235,6 +235,13 @@ open class PartialSheetPresentationController: UIPresentationController { partialSheetDelegate?.partialSheetPresentationControllerDidDismissSheet?(self) NotificationCenter.default.post(name: PartialSheetPresentationController.partialSheetDidDismissNotification, object: nil) + } else { + // This is a wildly hacky solution to the problem discussed here: https://thumbtack.slack.com/archives/C04L74B6M/p1697811811558819 + // "If you drag the sheet at all and then let go, the CTAs [and any other gestures] become unresponsive" + // Solution provided here: https://stackoverflow.com/a/74320743 + // TODO: (mdinicola) Check to see if this is solved in future iOS versions + presentedViewController.view.bounds.origin.y = .leastNonzeroMagnitude + presentedViewController.view.bounds.origin.y = .zero } }