From 326c9e0293fb04b4f1085fa90966dfdcc21f5283 Mon Sep 17 00:00:00 2001 From: Julius Marminge Date: Thu, 5 Nov 2026 01:30:57 +0000 Subject: [PATCH 1/4] fix(mobile): iPad composer drops when the keyboard floats On iPadOS, undocking the keyboard (floating mini keyboard, or the hardware-keyboard shortcuts bar collapsed to its pill) left the thread composer lifted at the docked keyboard height. react-native-keyboard-controller's iOS KeyboardMovementObserver only listens to willShow/willHide and takes the end frame height as-is, while UIKit undocks with willChangeFrame (and sometimes willShow) carrying the narrower floating frame. Extend the existing pnpm patch so a non-empty keyboard frame narrower than its screen counts as hidden: willShow with such a frame takes the hide path, and willChangeFrame with one hides only while a keyboard is reported, deferred a runloop turn so a willShow/willHide posted alongside fires events once. Docking again arrives as a full-width willShow and shows normally. AI-assisted; verified with the tests and tools listed above. Co-Authored-By: Claude Opus 5.5 --- ...ct-native-keyboard-controller@1.22.8.patch | 63 +++++++++++++++++++ pnpm-lock.yaml | 6 +- 2 files changed, 66 insertions(+), 3 deletions(-) diff --git a/patches/react-native-keyboard-controller@1.22.8.patch b/patches/react-native-keyboard-controller@1.22.8.patch index 3f307d3202cd..4e68a8b12150 100644 --- a/patches/react-native-keyboard-controller@1.22.8.patch +++ b/patches/react-native-keyboard-controller@1.22.8.patch @@ -1,3 +1,66 @@ +diff --git a/ios/observers/movement/observer/KeyboardMovementObserver+Lifecycle.swift b/ios/observers/movement/observer/KeyboardMovementObserver+Lifecycle.swift +index cdbd633..41a72bc 100644 +--- a/ios/observers/movement/observer/KeyboardMovementObserver+Lifecycle.swift ++++ b/ios/observers/movement/observer/KeyboardMovementObserver+Lifecycle.swift +@@ -25,6 +25,12 @@ public extension KeyboardMovementObserver { + name: UIResponder.keyboardWillShowNotification, + object: nil + ) ++ NotificationCenter.default.addObserver( ++ self, ++ selector: #selector(keyboardWillChangeFrame), ++ name: UIResponder.keyboardWillChangeFrameNotification, ++ object: nil ++ ) + } + + @objc func unmount() { +diff --git a/ios/observers/movement/observer/KeyboardMovementObserver+Listeners.swift b/ios/observers/movement/observer/KeyboardMovementObserver+Listeners.swift +index 545a5b2..2e60b85 100644 +--- a/ios/observers/movement/observer/KeyboardMovementObserver+Listeners.swift ++++ b/ios/observers/movement/observer/KeyboardMovementObserver+Listeners.swift +@@ -9,6 +9,11 @@ extension KeyboardMovementObserver { + @objc func keyboardWillAppear(_ notification: Notification) { + guard !UIResponder.isKeyboardPreloading else { return } + ++ if isFloatingKeyboard(notification) { ++ hideIfKeyboardShown(notification) ++ return ++ } ++ + let (duration, frame) = notification.keyboardMetaData() + if let keyboardFrame = frame { + tag = UIResponder.current.reactViewTag +@@ -36,6 +41,29 @@ extension KeyboardMovementObserver { + } + } + ++ @objc func keyboardWillChangeFrame(_ notification: Notification) { ++ guard !UIResponder.isKeyboardPreloading, isFloatingKeyboard(notification) else { return } ++ // runs after a willShow/willHide posted with this notification, so hide events fire once ++ DispatchQueue.main.async { [weak self] in ++ self?.hideIfKeyboardShown(notification) ++ } ++ } ++ ++ // iPadOS floating keyboards (and the collapsed shortcuts bar) cover no app content and are narrower ++ // than the screen; UIKit often undocks without willHide, so they must count as hidden. ++ private func isFloatingKeyboard(_ notification: Notification) -> Bool { ++ guard let frame = notification.keyboardMetaData().1?.cgRectValue, !frame.isEmpty else { return false } ++ let screen = notification.object as? UIScreen ?? UIScreen.main ++ return frame.width.rounded() < screen.bounds.width.rounded() ++ } ++ ++ private func hideIfKeyboardShown(_ notification: Notification) { ++ let targetHeight = self.notification?.keyboardMetaData().1?.cgRectValue.height ?? 0 ++ if targetHeight > 0 { ++ keyboardWillDisappear(notification) ++ } ++ } ++ + @objc func keyboardWillDisappear(_ notification: Notification) { + guard !UIResponder.isKeyboardPreloading else { return } + let (duration, _) = notification.keyboardMetaData() diff --git a/lib/commonjs/components/KeyboardChatScrollView/index.js b/lib/commonjs/components/KeyboardChatScrollView/index.js index 0b78ff3..98b3b6c 100644 --- a/lib/commonjs/components/KeyboardChatScrollView/index.js diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 71ad239cc0d3..cbcf9243b962 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -384,7 +384,7 @@ patchedDependencies: node-pty@1.2.0-beta.15: f1e680afec85f650699ea756f91f469844ec4c976f4f168492a45c6b3f67d651 react-native-gesture-handler@3.3.0: abe20e1d1c23549297cbbc818e14fe479b41455930d9663135d6b40fe359b626 react-native-image-viewing@0.2.2: 4aa038d541c7ddcc8f1437eb3e7b4f769f61de78e7f91b53f9805dfca608474d - react-native-keyboard-controller@1.22.8: 6eb6c847ac693b636ec97c83575acd44b77e92ad0d2c776de0cb4e78e8fb9d4f + react-native-keyboard-controller@1.22.8: 26d1c53bcbd38c056da44abfff0812aae1a55e4a627732ef4416ba07344a8f6c react-native-pdf-jsi@5.0.0: 6f52854210f61bef499850ebd498229a111bc34ec5b2a4925e644f2f48f42760 react-native-reanimated@4.7.1: 95ee26e5fcab5f50bc4b4c47b3f7e6278a0b20850205efb9f6ee7e70a22d2b59 react-native-webview@14.0.1: 81caa279ec3dc1f81209062133b66e8f824e13f106cca57f1fa732a72c2ab378 @@ -745,7 +745,7 @@ importers: version: 0.2.2(patch_hash=4aa038d541c7ddcc8f1437eb3e7b4f769f61de78e7f91b53f9805dfca608474d)(react-native@0.88.0(@babel/core@7.29.7(supports-color@8.1.1))(@react-native/metro-config@0.88.0(@babel/core@7.29.7(supports-color@8.1.1))(bufferutil@4.1.0)(supports-color@8.1.1)(utf-8-validate@6.0.6))(@types/react@19.3.0)(bufferutil@4.1.0)(react@19.3.0)(supports-color@8.1.1)(utf-8-validate@6.0.6))(react@19.3.0) react-native-keyboard-controller: specifier: 1.22.8 - version: 1.22.8(patch_hash=6eb6c847ac693b636ec97c83575acd44b77e92ad0d2c776de0cb4e78e8fb9d4f)(e2a826d844fe10cdcbda558127861778) + version: 1.22.8(patch_hash=26d1c53bcbd38c056da44abfff0812aae1a55e4a627732ef4416ba07344a8f6c)(e2a826d844fe10cdcbda558127861778) react-native-nitro-modules: specifier: 0.37.1 version: 0.37.1(react-native@0.88.0(@babel/core@7.29.7(supports-color@8.1.1))(@react-native/metro-config@0.88.0(@babel/core@7.29.7(supports-color@8.1.1))(bufferutil@4.1.0)(supports-color@8.1.1)(utf-8-validate@6.0.6))(@types/react@19.3.0)(bufferutil@4.1.0)(react@19.3.0)(supports-color@8.1.1)(utf-8-validate@6.0.6))(react@19.3.0) @@ -20986,7 +20986,7 @@ snapshots: react: 19.3.0 react-native: 0.88.0(@babel/core@7.29.7(supports-color@8.1.1))(@react-native/metro-config@0.88.0(@babel/core@7.29.7(supports-color@8.1.1))(bufferutil@4.1.0)(supports-color@8.1.1)(utf-8-validate@6.0.6))(@types/react@19.3.0)(bufferutil@4.1.0)(react@19.3.0)(supports-color@8.1.1)(utf-8-validate@6.0.6) - react-native-keyboard-controller@1.22.8(patch_hash=6eb6c847ac693b636ec97c83575acd44b77e92ad0d2c776de0cb4e78e8fb9d4f)(e2a826d844fe10cdcbda558127861778): + react-native-keyboard-controller@1.22.8(patch_hash=26d1c53bcbd38c056da44abfff0812aae1a55e4a627732ef4416ba07344a8f6c)(e2a826d844fe10cdcbda558127861778): dependencies: react: 19.3.0 react-native: 0.88.0(@babel/core@7.29.7(supports-color@8.1.1))(@react-native/metro-config@0.88.0(@babel/core@7.29.7(supports-color@8.1.1))(bufferutil@4.1.0)(supports-color@8.1.1)(utf-8-validate@6.0.6))(@types/react@19.3.0)(bufferutil@4.1.0)(react@19.3.0)(supports-color@8.1.1)(utf-8-validate@6.0.6) From 722e3dd0bb6a9d52cd49d513f275619da0e10d9d Mon Sep 17 00:00:00 2001 From: Julius Marminge Date: Thu, 5 Nov 2026 01:47:12 +0000 Subject: [PATCH 2/4] fix(mobile): cancel the deferred floating-keyboard hide on a newer show or hide A willShow or willHide arriving before the queued hide runs now cancels it, so a docked show is never undone by a stale floating frame and hide events fire once. Co-Authored-By: Claude Opus 5.5 --- ...ct-native-keyboard-controller@1.22.8.patch | 35 ++++++++++++++----- pnpm-lock.yaml | 6 ++-- 2 files changed, 30 insertions(+), 11 deletions(-) diff --git a/patches/react-native-keyboard-controller@1.22.8.patch b/patches/react-native-keyboard-controller@1.22.8.patch index 4e68a8b12150..2b48f76ab2c3 100644 --- a/patches/react-native-keyboard-controller@1.22.8.patch +++ b/patches/react-native-keyboard-controller@1.22.8.patch @@ -16,31 +16,35 @@ index cdbd633..41a72bc 100644 @objc func unmount() { diff --git a/ios/observers/movement/observer/KeyboardMovementObserver+Listeners.swift b/ios/observers/movement/observer/KeyboardMovementObserver+Listeners.swift -index 545a5b2..2e60b85 100644 +index 545a5b2..0278af5 100644 --- a/ios/observers/movement/observer/KeyboardMovementObserver+Listeners.swift +++ b/ios/observers/movement/observer/KeyboardMovementObserver+Listeners.swift -@@ -9,6 +9,11 @@ extension KeyboardMovementObserver { +@@ -8,6 +8,12 @@ + extension KeyboardMovementObserver { @objc func keyboardWillAppear(_ notification: Notification) { guard !UIResponder.isKeyboardPreloading else { return } - ++ floatingHideTask?.cancel() ++ + if isFloatingKeyboard(notification) { + hideIfKeyboardShown(notification) + return + } -+ + let (duration, frame) = notification.keyboardMetaData() if let keyboardFrame = frame { - tag = UIResponder.current.reactViewTag -@@ -36,6 +41,29 @@ extension KeyboardMovementObserver { +@@ -36,8 +42,35 @@ extension KeyboardMovementObserver { } } + @objc func keyboardWillChangeFrame(_ notification: Notification) { + guard !UIResponder.isKeyboardPreloading, isFloatingKeyboard(notification) else { return } -+ // runs after a willShow/willHide posted with this notification, so hide events fire once -+ DispatchQueue.main.async { [weak self] in ++ // runs after a willShow/willHide posted with this notification, which cancel it, so hide events fire once ++ floatingHideTask?.cancel() ++ let task = DispatchWorkItem { [weak self] in + self?.hideIfKeyboardShown(notification) + } ++ floatingHideTask = task ++ DispatchQueue.main.async(execute: task) + } + + // iPadOS floating keyboards (and the collapsed shortcuts bar) cover no app content and are narrower @@ -60,7 +64,22 @@ index 545a5b2..2e60b85 100644 + @objc func keyboardWillDisappear(_ notification: Notification) { guard !UIResponder.isKeyboardPreloading else { return } ++ floatingHideTask?.cancel() let (duration, _) = notification.keyboardMetaData() + tag = UIResponder.current.reactViewTag + self.notification = notification +diff --git a/ios/observers/movement/observer/KeyboardMovementObserver.swift b/ios/observers/movement/observer/KeyboardMovementObserver.swift +index ae97d61..2ea1d2d 100644 +--- a/ios/observers/movement/observer/KeyboardMovementObserver.swift ++++ b/ios/observers/movement/observer/KeyboardMovementObserver.swift +@@ -37,6 +37,7 @@ public class KeyboardMovementObserver: NSObject { + // manual did events + var notification: Notification? + var keyboardDidTask: DispatchWorkItem? ++ var floatingHideTask: DispatchWorkItem? + + @objc public init( + handler: @escaping (NSString, NSNumber, NSNumber, NSNumber, NSNumber) -> Void, diff --git a/lib/commonjs/components/KeyboardChatScrollView/index.js b/lib/commonjs/components/KeyboardChatScrollView/index.js index 0b78ff3..98b3b6c 100644 --- a/lib/commonjs/components/KeyboardChatScrollView/index.js diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index cbcf9243b962..165eee1f0069 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -384,7 +384,7 @@ patchedDependencies: node-pty@1.2.0-beta.15: f1e680afec85f650699ea756f91f469844ec4c976f4f168492a45c6b3f67d651 react-native-gesture-handler@3.3.0: abe20e1d1c23549297cbbc818e14fe479b41455930d9663135d6b40fe359b626 react-native-image-viewing@0.2.2: 4aa038d541c7ddcc8f1437eb3e7b4f769f61de78e7f91b53f9805dfca608474d - react-native-keyboard-controller@1.22.8: 26d1c53bcbd38c056da44abfff0812aae1a55e4a627732ef4416ba07344a8f6c + react-native-keyboard-controller@1.22.8: ade625ffc39af3449496b307a6b5b2bbc386ef41de05a725ac27ec174bd54570 react-native-pdf-jsi@5.0.0: 6f52854210f61bef499850ebd498229a111bc34ec5b2a4925e644f2f48f42760 react-native-reanimated@4.7.1: 95ee26e5fcab5f50bc4b4c47b3f7e6278a0b20850205efb9f6ee7e70a22d2b59 react-native-webview@14.0.1: 81caa279ec3dc1f81209062133b66e8f824e13f106cca57f1fa732a72c2ab378 @@ -745,7 +745,7 @@ importers: version: 0.2.2(patch_hash=4aa038d541c7ddcc8f1437eb3e7b4f769f61de78e7f91b53f9805dfca608474d)(react-native@0.88.0(@babel/core@7.29.7(supports-color@8.1.1))(@react-native/metro-config@0.88.0(@babel/core@7.29.7(supports-color@8.1.1))(bufferutil@4.1.0)(supports-color@8.1.1)(utf-8-validate@6.0.6))(@types/react@19.3.0)(bufferutil@4.1.0)(react@19.3.0)(supports-color@8.1.1)(utf-8-validate@6.0.6))(react@19.3.0) react-native-keyboard-controller: specifier: 1.22.8 - version: 1.22.8(patch_hash=26d1c53bcbd38c056da44abfff0812aae1a55e4a627732ef4416ba07344a8f6c)(e2a826d844fe10cdcbda558127861778) + version: 1.22.8(patch_hash=ade625ffc39af3449496b307a6b5b2bbc386ef41de05a725ac27ec174bd54570)(e2a826d844fe10cdcbda558127861778) react-native-nitro-modules: specifier: 0.37.1 version: 0.37.1(react-native@0.88.0(@babel/core@7.29.7(supports-color@8.1.1))(@react-native/metro-config@0.88.0(@babel/core@7.29.7(supports-color@8.1.1))(bufferutil@4.1.0)(supports-color@8.1.1)(utf-8-validate@6.0.6))(@types/react@19.3.0)(bufferutil@4.1.0)(react@19.3.0)(supports-color@8.1.1)(utf-8-validate@6.0.6))(react@19.3.0) @@ -20986,7 +20986,7 @@ snapshots: react: 19.3.0 react-native: 0.88.0(@babel/core@7.29.7(supports-color@8.1.1))(@react-native/metro-config@0.88.0(@babel/core@7.29.7(supports-color@8.1.1))(bufferutil@4.1.0)(supports-color@8.1.1)(utf-8-validate@6.0.6))(@types/react@19.3.0)(bufferutil@4.1.0)(react@19.3.0)(supports-color@8.1.1)(utf-8-validate@6.0.6) - react-native-keyboard-controller@1.22.8(patch_hash=26d1c53bcbd38c056da44abfff0812aae1a55e4a627732ef4416ba07344a8f6c)(e2a826d844fe10cdcbda558127861778): + react-native-keyboard-controller@1.22.8(patch_hash=ade625ffc39af3449496b307a6b5b2bbc386ef41de05a725ac27ec174bd54570)(e2a826d844fe10cdcbda558127861778): dependencies: react: 19.3.0 react-native: 0.88.0(@babel/core@7.29.7(supports-color@8.1.1))(@react-native/metro-config@0.88.0(@babel/core@7.29.7(supports-color@8.1.1))(bufferutil@4.1.0)(supports-color@8.1.1)(utf-8-validate@6.0.6))(@types/react@19.3.0)(bufferutil@4.1.0)(react@19.3.0)(supports-color@8.1.1)(utf-8-validate@6.0.6) From 6579cfec725f6a57adeecff1d9188ad5fbc43c6a Mon Sep 17 00:00:00 2001 From: Julius Marminge Date: Thu, 5 Nov 2026 02:03:44 +0000 Subject: [PATCH 3/4] fix(mobile): count the iPad minimized keyboard as hidden On iPadOS 26, hiding the keyboard while the composer keeps focus leaves a minimized keyboard. UIKit moves it with a full-width frame that ends above the screen bottom (y 1206, height 66 on a 13-inch iPad, duration 0) and posts no willHide, so the composer stayed lifted. A keyboard counts as docked only when it spans the screen width and reaches the screen bottom. Co-Authored-By: Claude Opus 5.5 --- patches/react-native-keyboard-controller@1.22.8.patch | 10 +++++----- pnpm-lock.yaml | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/patches/react-native-keyboard-controller@1.22.8.patch b/patches/react-native-keyboard-controller@1.22.8.patch index 2b48f76ab2c3..d580c7a80ae7 100644 --- a/patches/react-native-keyboard-controller@1.22.8.patch +++ b/patches/react-native-keyboard-controller@1.22.8.patch @@ -16,7 +16,7 @@ index cdbd633..41a72bc 100644 @objc func unmount() { diff --git a/ios/observers/movement/observer/KeyboardMovementObserver+Listeners.swift b/ios/observers/movement/observer/KeyboardMovementObserver+Listeners.swift -index 545a5b2..0278af5 100644 +index 545a5b2..ff4d4ae 100644 --- a/ios/observers/movement/observer/KeyboardMovementObserver+Listeners.swift +++ b/ios/observers/movement/observer/KeyboardMovementObserver+Listeners.swift @@ -8,6 +8,12 @@ @@ -47,12 +47,12 @@ index 545a5b2..0278af5 100644 + DispatchQueue.main.async(execute: task) + } + -+ // iPadOS floating keyboards (and the collapsed shortcuts bar) cover no app content and are narrower -+ // than the screen; UIKit often undocks without willHide, so they must count as hidden. ++ // iPadOS floating and minimized keyboards are narrower than the screen or end above its bottom, so they ++ // cover no app content; UIKit switches to them without willHide, so they must count as hidden. + private func isFloatingKeyboard(_ notification: Notification) -> Bool { + guard let frame = notification.keyboardMetaData().1?.cgRectValue, !frame.isEmpty else { return false } -+ let screen = notification.object as? UIScreen ?? UIScreen.main -+ return frame.width.rounded() < screen.bounds.width.rounded() ++ let screen = (notification.object as? UIScreen ?? UIScreen.main).bounds ++ return frame.width.rounded() < screen.width.rounded() || frame.maxY.rounded() < screen.height.rounded() + } + + private func hideIfKeyboardShown(_ notification: Notification) { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 165eee1f0069..4a9ef8f57735 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -384,7 +384,7 @@ patchedDependencies: node-pty@1.2.0-beta.15: f1e680afec85f650699ea756f91f469844ec4c976f4f168492a45c6b3f67d651 react-native-gesture-handler@3.3.0: abe20e1d1c23549297cbbc818e14fe479b41455930d9663135d6b40fe359b626 react-native-image-viewing@0.2.2: 4aa038d541c7ddcc8f1437eb3e7b4f769f61de78e7f91b53f9805dfca608474d - react-native-keyboard-controller@1.22.8: ade625ffc39af3449496b307a6b5b2bbc386ef41de05a725ac27ec174bd54570 + react-native-keyboard-controller@1.22.8: f80cef01f90d14882350421189b41538d975b20233c624816f0d1045dfdf4d24 react-native-pdf-jsi@5.0.0: 6f52854210f61bef499850ebd498229a111bc34ec5b2a4925e644f2f48f42760 react-native-reanimated@4.7.1: 95ee26e5fcab5f50bc4b4c47b3f7e6278a0b20850205efb9f6ee7e70a22d2b59 react-native-webview@14.0.1: 81caa279ec3dc1f81209062133b66e8f824e13f106cca57f1fa732a72c2ab378 @@ -745,7 +745,7 @@ importers: version: 0.2.2(patch_hash=4aa038d541c7ddcc8f1437eb3e7b4f769f61de78e7f91b53f9805dfca608474d)(react-native@0.88.0(@babel/core@7.29.7(supports-color@8.1.1))(@react-native/metro-config@0.88.0(@babel/core@7.29.7(supports-color@8.1.1))(bufferutil@4.1.0)(supports-color@8.1.1)(utf-8-validate@6.0.6))(@types/react@19.3.0)(bufferutil@4.1.0)(react@19.3.0)(supports-color@8.1.1)(utf-8-validate@6.0.6))(react@19.3.0) react-native-keyboard-controller: specifier: 1.22.8 - version: 1.22.8(patch_hash=ade625ffc39af3449496b307a6b5b2bbc386ef41de05a725ac27ec174bd54570)(e2a826d844fe10cdcbda558127861778) + version: 1.22.8(patch_hash=f80cef01f90d14882350421189b41538d975b20233c624816f0d1045dfdf4d24)(e2a826d844fe10cdcbda558127861778) react-native-nitro-modules: specifier: 0.37.1 version: 0.37.1(react-native@0.88.0(@babel/core@7.29.7(supports-color@8.1.1))(@react-native/metro-config@0.88.0(@babel/core@7.29.7(supports-color@8.1.1))(bufferutil@4.1.0)(supports-color@8.1.1)(utf-8-validate@6.0.6))(@types/react@19.3.0)(bufferutil@4.1.0)(react@19.3.0)(supports-color@8.1.1)(utf-8-validate@6.0.6))(react@19.3.0) @@ -20986,7 +20986,7 @@ snapshots: react: 19.3.0 react-native: 0.88.0(@babel/core@7.29.7(supports-color@8.1.1))(@react-native/metro-config@0.88.0(@babel/core@7.29.7(supports-color@8.1.1))(bufferutil@4.1.0)(supports-color@8.1.1)(utf-8-validate@6.0.6))(@types/react@19.3.0)(bufferutil@4.1.0)(react@19.3.0)(supports-color@8.1.1)(utf-8-validate@6.0.6) - react-native-keyboard-controller@1.22.8(patch_hash=ade625ffc39af3449496b307a6b5b2bbc386ef41de05a725ac27ec174bd54570)(e2a826d844fe10cdcbda558127861778): + react-native-keyboard-controller@1.22.8(patch_hash=f80cef01f90d14882350421189b41538d975b20233c624816f0d1045dfdf4d24)(e2a826d844fe10cdcbda558127861778): dependencies: react: 19.3.0 react-native: 0.88.0(@babel/core@7.29.7(supports-color@8.1.1))(@react-native/metro-config@0.88.0(@babel/core@7.29.7(supports-color@8.1.1))(bufferutil@4.1.0)(supports-color@8.1.1)(utf-8-validate@6.0.6))(@types/react@19.3.0)(bufferutil@4.1.0)(react@19.3.0)(supports-color@8.1.1)(utf-8-validate@6.0.6) From 3540949a748b11b326ec039a36e4a73e95d28c99 Mon Sep 17 00:00:00 2001 From: Julius Marminge Date: Thu, 5 Nov 2026 02:36:22 +0000 Subject: [PATCH 4/4] fix(mobile): keep the Slide Over docked keyboard reported In Slide Over UIKit reports a docked keyboard ending at the app window's bottom rather than the screen's, so compare against the lower of the two. Co-Authored-By: Claude Opus 5.5 --- .../react-native-keyboard-controller@1.22.8.patch | 15 ++++++++++----- pnpm-lock.yaml | 6 +++--- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/patches/react-native-keyboard-controller@1.22.8.patch b/patches/react-native-keyboard-controller@1.22.8.patch index d580c7a80ae7..4c13280a6ed1 100644 --- a/patches/react-native-keyboard-controller@1.22.8.patch +++ b/patches/react-native-keyboard-controller@1.22.8.patch @@ -16,7 +16,7 @@ index cdbd633..41a72bc 100644 @objc func unmount() { diff --git a/ios/observers/movement/observer/KeyboardMovementObserver+Listeners.swift b/ios/observers/movement/observer/KeyboardMovementObserver+Listeners.swift -index 545a5b2..ff4d4ae 100644 +index 545a5b2..fbdc984 100644 --- a/ios/observers/movement/observer/KeyboardMovementObserver+Listeners.swift +++ b/ios/observers/movement/observer/KeyboardMovementObserver+Listeners.swift @@ -8,6 +8,12 @@ @@ -32,7 +32,7 @@ index 545a5b2..ff4d4ae 100644 let (duration, frame) = notification.keyboardMetaData() if let keyboardFrame = frame { -@@ -36,8 +42,35 @@ extension KeyboardMovementObserver { +@@ -36,8 +42,40 @@ extension KeyboardMovementObserver { } } @@ -47,12 +47,17 @@ index 545a5b2..ff4d4ae 100644 + DispatchQueue.main.async(execute: task) + } + -+ // iPadOS floating and minimized keyboards are narrower than the screen or end above its bottom, so they -+ // cover no app content; UIKit switches to them without willHide, so they must count as hidden. ++ // iPadOS floating and minimized keyboards are narrower than the screen or end above the app's bottom, so ++ // they cover no app content; UIKit switches to them without willHide, so they must count as hidden. + private func isFloatingKeyboard(_ notification: Notification) -> Bool { + guard let frame = notification.keyboardMetaData().1?.cgRectValue, !frame.isEmpty else { return false } + let screen = (notification.object as? UIScreen ?? UIScreen.main).bounds -+ return frame.width.rounded() < screen.width.rounded() || frame.maxY.rounded() < screen.height.rounded() ++ // in Slide Over a docked keyboard ends at the app window's bottom, above the screen's ++ let windowBottom = UIApplication.shared.activeWindow.map { ++ $0.convert($0.bounds, to: $0.screen.coordinateSpace).maxY ++ } ?? screen.height ++ let dockedBottom = min(screen.height, windowBottom) ++ return frame.width.rounded() < screen.width.rounded() || frame.maxY.rounded() < dockedBottom.rounded() + } + + private func hideIfKeyboardShown(_ notification: Notification) { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 4a9ef8f57735..5ef8d89bd907 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -384,7 +384,7 @@ patchedDependencies: node-pty@1.2.0-beta.15: f1e680afec85f650699ea756f91f469844ec4c976f4f168492a45c6b3f67d651 react-native-gesture-handler@3.3.0: abe20e1d1c23549297cbbc818e14fe479b41455930d9663135d6b40fe359b626 react-native-image-viewing@0.2.2: 4aa038d541c7ddcc8f1437eb3e7b4f769f61de78e7f91b53f9805dfca608474d - react-native-keyboard-controller@1.22.8: f80cef01f90d14882350421189b41538d975b20233c624816f0d1045dfdf4d24 + react-native-keyboard-controller@1.22.8: 3fa3d03e203a23165a439c4cddf5372ccd53acf337389793211be64dcdafccef react-native-pdf-jsi@5.0.0: 6f52854210f61bef499850ebd498229a111bc34ec5b2a4925e644f2f48f42760 react-native-reanimated@4.7.1: 95ee26e5fcab5f50bc4b4c47b3f7e6278a0b20850205efb9f6ee7e70a22d2b59 react-native-webview@14.0.1: 81caa279ec3dc1f81209062133b66e8f824e13f106cca57f1fa732a72c2ab378 @@ -745,7 +745,7 @@ importers: version: 0.2.2(patch_hash=4aa038d541c7ddcc8f1437eb3e7b4f769f61de78e7f91b53f9805dfca608474d)(react-native@0.88.0(@babel/core@7.29.7(supports-color@8.1.1))(@react-native/metro-config@0.88.0(@babel/core@7.29.7(supports-color@8.1.1))(bufferutil@4.1.0)(supports-color@8.1.1)(utf-8-validate@6.0.6))(@types/react@19.3.0)(bufferutil@4.1.0)(react@19.3.0)(supports-color@8.1.1)(utf-8-validate@6.0.6))(react@19.3.0) react-native-keyboard-controller: specifier: 1.22.8 - version: 1.22.8(patch_hash=f80cef01f90d14882350421189b41538d975b20233c624816f0d1045dfdf4d24)(e2a826d844fe10cdcbda558127861778) + version: 1.22.8(patch_hash=3fa3d03e203a23165a439c4cddf5372ccd53acf337389793211be64dcdafccef)(e2a826d844fe10cdcbda558127861778) react-native-nitro-modules: specifier: 0.37.1 version: 0.37.1(react-native@0.88.0(@babel/core@7.29.7(supports-color@8.1.1))(@react-native/metro-config@0.88.0(@babel/core@7.29.7(supports-color@8.1.1))(bufferutil@4.1.0)(supports-color@8.1.1)(utf-8-validate@6.0.6))(@types/react@19.3.0)(bufferutil@4.1.0)(react@19.3.0)(supports-color@8.1.1)(utf-8-validate@6.0.6))(react@19.3.0) @@ -20986,7 +20986,7 @@ snapshots: react: 19.3.0 react-native: 0.88.0(@babel/core@7.29.7(supports-color@8.1.1))(@react-native/metro-config@0.88.0(@babel/core@7.29.7(supports-color@8.1.1))(bufferutil@4.1.0)(supports-color@8.1.1)(utf-8-validate@6.0.6))(@types/react@19.3.0)(bufferutil@4.1.0)(react@19.3.0)(supports-color@8.1.1)(utf-8-validate@6.0.6) - react-native-keyboard-controller@1.22.8(patch_hash=f80cef01f90d14882350421189b41538d975b20233c624816f0d1045dfdf4d24)(e2a826d844fe10cdcbda558127861778): + react-native-keyboard-controller@1.22.8(patch_hash=3fa3d03e203a23165a439c4cddf5372ccd53acf337389793211be64dcdafccef)(e2a826d844fe10cdcbda558127861778): dependencies: react: 19.3.0 react-native: 0.88.0(@babel/core@7.29.7(supports-color@8.1.1))(@react-native/metro-config@0.88.0(@babel/core@7.29.7(supports-color@8.1.1))(bufferutil@4.1.0)(supports-color@8.1.1)(utf-8-validate@6.0.6))(@types/react@19.3.0)(bufferutil@4.1.0)(react@19.3.0)(supports-color@8.1.1)(utf-8-validate@6.0.6)