Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix (iOS): Only try to make the alert window key if the app recognizes it #1008

Merged

Conversation

amgleitman
Copy link
Member

Please select one of the following

  • I am removing an existing difference between facebook/react-native and microsoft/react-native-macos 👍
  • I am cherry-picking a change from Facebook's react-native into microsoft/react-native-macos 👍
  • I am making a fix / change for the macOS implementation of react-native
  • I am making a change required for Microsoft usage of react-native

Summary

This is a follow-up to #917.

In iOS 14, if we call -[UIWindow makeKeyAndVisible] from a UIWindow that isn't part of the app, the current key window gets made non-key. This can result in RCTKeyWindow(), and thusly, RCTPresentedViewController(), to come back as nil, which means that the alert never shows up.

The fix here is to ensure that we don't try to make the alert window key unless it's actually tracked by the application.

Test Plan

Validated in a downstream app on iOS 14.

@amgleitman amgleitman requested a review from a team as a code owner February 4, 2022 23:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants