From 1a348ad72ea0c2658b248c3d81f82252177e86ae Mon Sep 17 00:00:00 2001 From: Saeb Amini Date: Wed, 30 Sep 2026 16:39:46 +1000 Subject: [PATCH] fix(ios): ignore keyboard show events when running as an iOS app on Mac --- ios/Sources/KeyboardPlugin/Keyboard.m | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ios/Sources/KeyboardPlugin/Keyboard.m b/ios/Sources/KeyboardPlugin/Keyboard.m index 72cfe2f..3e65bb8 100644 --- a/ios/Sources/KeyboardPlugin/Keyboard.m +++ b/ios/Sources/KeyboardPlugin/Keyboard.m @@ -223,6 +223,9 @@ - (void)onKeyboardWillHide:(NSNotification *)notification - (void)onKeyboardWillShow:(NSNotification *)notification { + // Macs have no virtual keyboard, but UIKit still posts these notifications with a bogus frame + if (NSProcessInfo.processInfo.isiOSAppOnMac) return; + if (hideTimer != nil) { [hideTimer invalidate]; } @@ -266,6 +269,8 @@ - (void)onKeyboardWillShow:(NSNotification *)notification - (void)onKeyboardDidShow:(NSNotification *)notification { + if (NSProcessInfo.processInfo.isiOSAppOnMac) return; + CGRect rect = [[notification.userInfo valueForKey:UIKeyboardFrameEndUserInfoKey] CGRectValue]; double height = rect.size.height;