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;