From cc60da98dcc2912e9473822551ad4eaf9cbf2136 Mon Sep 17 00:00:00 2001 From: Muukii Date: Tue, 21 Jul 2026 22:03:59 +0900 Subject: [PATCH 1/2] Update --- Rideau/Core/RideauView.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Rideau/Core/RideauView.swift b/Rideau/Core/RideauView.swift index fc27f0b..e5948ac 100644 --- a/Rideau/Core/RideauView.swift +++ b/Rideau/Core/RideauView.swift @@ -105,7 +105,7 @@ extension RideauView { /** A view that manages sheet UI. - You may use ``RideauContentType`` in a view what you want to show in the sheet. + You may use ``RideauContentType`` in a view what you want to show in the sheet. */ public final class RideauView: RideauTouchThroughView { @@ -296,7 +296,7 @@ public final class RideauView: RideauTouchThroughView { } let screenHeight = UIScreen.main.bounds.height - return screenHeight - v.cgRectValue.minY + return max(0, screenHeight - v.cgRectValue.minY) } var animationDuration: Double { From cc8c18213a3cb4196ebb0d20a61f2dbf65b8cbf3 Mon Sep 17 00:00:00 2001 From: Muukii Date: Tue, 21 Jul 2026 23:16:40 +0900 Subject: [PATCH 2/2] Fix keyboard handling if its 0 --- Rideau/Core/RideauView.swift | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/Rideau/Core/RideauView.swift b/Rideau/Core/RideauView.swift index e5948ac..eb9da2c 100644 --- a/Rideau/Core/RideauView.swift +++ b/Rideau/Core/RideauView.swift @@ -290,13 +290,21 @@ public final class RideauView: RideauTouchThroughView { return } - var keyboardHeight: CGFloat? { - guard let v = note.userInfo?[UIResponder.keyboardFrameEndUserInfoKey] as? NSValue else { - return nil + var keyboardOverlapHeight: CGFloat { + guard + let value = note.userInfo?[UIResponder.keyboardFrameEndUserInfoKey] as? NSValue, + let window + else { + return 0 } - let screenHeight = UIScreen.main.bounds.height - return max(0, screenHeight - v.cgRectValue.minY) + let frame = convert(value.cgRectValue, from: window.screen.coordinateSpace) + + guard !frame.isEmpty, frame.maxY >= bounds.maxY else { + return 0 + } + + return max(0, bounds.maxY - frame.minY) } var animationDuration: Double { @@ -319,7 +327,7 @@ public final class RideauView: RideauTouchThroughView { delay: 0, options: UIView.AnimationOptions(rawValue: UInt(animationCurve << 16)), animations: { - self.bottom.constant = -keyboardHeight! + self.bottom.constant = -keyboardOverlapHeight self.layoutIfNeeded() }, completion: nil