Repository navigation
fix: KeyboardInput - dismissKeyboard without AppDelegate.window - #4053
Open
AlicanAkyol wants to merge 1 commit into
Open
AlicanAkyol wants to merge 1 commit into
AlicanAkyol wants to merge 1 commit into
Conversation
dismissKeyboard searched for the first responder from [UIApplication sharedApplication].delegate.window, which apps on the UIKit scene life cycle (React Native 0.88 template, Expo SDK 58) do not have, so it threw '-[AppDelegate window]: unrecognized selector'. Start from RCTKeyWindow() instead.
This branch has not been deployed
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.
dismissKeyboardinRCTCustomInputControllerTemp.mlooks for the first responder starting from[UIApplication sharedApplication].delegate.window.With the UIKit scene life cycle the window belongs to the scene delegate and the AppDelegate has no
windowproperty. That is the React Native 0.88 template, and Expo SDK 58 (SDK 57 withenableSceneSupport). Apple requires the scene life cycle for apps built with the iOS 27 SDK (TN3187), and App Store uploads need that SDK from April 2027. In such an app,dismissKeyboardthrows:This starts the search from
RCTKeyWindow()(<React/RCTUtils.h>), which returns the same window on the classic life cycle and the scene's key window otherwise. It's the onlydelegate.windowuse I found in the package.Testing: I reproduced this crash pattern, and confirmed the same fix, with two other libraries on a fresh React Native 0.88.0-rc.4 app in the iOS simulator (react-native-blob-util#498, invertase/react-native-google-mobile-ads#911, the latter now approved). I have not run the ui-lib demo app.
Found while adding a UIScene check to NativeKeel, a React Native health-check CLI I maintain.