Repository navigation
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Early-return from
onKeyboardWillShow:andonKeyboardDidShow:whenNSProcessInfo.processInfo.isiOSAppOnMacis true.Context
When an iPad app runs on Apple Silicon Macs ("Designed for iPad", including installs from the Mac App Store), there is no virtual keyboard, but UIKit still posts
UIKeyboardWillShowNotification/UIKeyboardDidShowNotificationwhenever a text input gains focus.Because
userInterfaceIdiomis.padon Mac, the plugin goes through the iPad/Stage Manager path and derives a "keyboard height" from the Mac window/screen geometry. Withresizeset toionic,bodyornative, this shrinks the web content by that amount. The result is the layout shifting up and an empty area appearing at the bottom of the window for a keyboard that doesn't exist.Since a virtual keyboard never appears on Mac, ignoring these notifications there is the simplest correct behaviour.
isiOSAppOnMacis available from iOS 14, below the plugin's iOS 15 minimum.Type of changes
Platforms affected
Tests
Tested with an Ionic/Capacitor 8 app using
resize: 'ionic', run from Xcode on "My Mac (Designed for iPad)". Before the change, focusing any input shrinksion-appand leaves an empty band at the bottom of the window. After the change, the layout stays put. iPhone/iPad are unaffected because the guard is only true when running on a Mac.