-
Notifications
You must be signed in to change notification settings - Fork 24.3k
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
iOS 15 only : Alert leaves behind invisible window that steals all user interaction #32304
Comments
I am able to reproduce this also. With both iOS 15 and iOS 14.5. |
That's a serious issue here, it also breaks automation tests when using Detox (and a real bug generally). 🔴 🔴 🔴 |
I confirm this is a serious issue very annoying for user. I am facing it using RN 0.64.2. |
Resolves this issue: facebook#32304. Without this change, calling to hide an alert, leaves a `UIWindow` that blocks user interactions with the screen. The correct way to remove a `UIWindow` in iOS is to set its hidden property to `YES`. Also, it is required to remove all references to the window (the associated `windowScene` for example) and ARC will automatically free this `UIWindow`.
Resolves this issue: facebook#32304. Without this change, calling to hide an alert, leaves a `UIWindow` that blocks user interactions with the screen. The correct way to remove a `UIWindow` in iOS is to set its hidden property to `YES`. Also, it is required to remove all references to the window (the associated `windowScene` for example) and ARC will automatically free this `UIWindow`. Co-authored-by: paddlefish <paddlefish@users.noreply.github.com>
Resolves this issue: facebook#32304. Without this change, calling to hide an alert, leaves a `UIWindow` that blocks user interactions with the screen. The correct way to remove a `UIWindow` in iOS is to set its hidden property to `YES`. Also, it is required to remove all references to the window (the associated `windowScene` for example) and ARC will automatically free this `UIWindow`. Co-authored-by: paddlefish <paddlefish@users.noreply.github.com>
Resolves this issue: facebook#32304. Without this change, calling to hide an alert, leaves a `UIWindow` that blocks user interactions with the screen. The correct way to remove a `UIWindow` in iOS is to set its hidden property to `YES`. Also, it is required to remove all references to the window (the associated `windowScene` for example) and ARC will automatically free this `UIWindow`. Co-authored-by: paddlefish <paddlefish@users.noreply.github.com>
Summary: Resolves this issue: #32304. **NOTE:** This PR is based on a prior PR for this fix: #32305, I've co-authorized its creator for this change (paddlefish). Without this change, calling to hide an alert, leaves a `UIWindow` that blocks user interactions with the screen. The correct way to remove a `UIWindow` in iOS is to set its hidden property to `YES`. Also, it is required to remove all references to the window (the associated `windowScene` for example) and ARC will automatically free this `UIWindow`. The line after this change, set the `_alertWindow` reference to `nil`, but the window is already associated with a scene (see the screenshots from [this PR](#32305 (comment))). So we also need to remove the `windowScene` from that window, as recommended by Apple: https://developer.apple.com/documentation/uikit/uiwindowscene/3198091-windows. >To remove the window from the current scene, or move it to a different scene, change the value of the window's windowScene property. ## Changelog <!-- Help reviewers and the release process by writing your own changelog entry. For an example, see: https://github.com/facebook/react-native/wiki/Changelog --> [iOS] [Fixed] - remove alert's window when call to `hide`. Pull Request resolved: #32833 Test Plan: See #32305 Reviewed By: hramos Differential Revision: D33460430 Pulled By: lunaleaps fbshipit-source-id: b13c2c7ee6404f1e1c787265bc4af8a31005bcf1
Summary: Resolves this issue: #32304. **NOTE:** This PR is based on a prior PR for this fix: #32305, I've co-authorized its creator for this change (paddlefish). Without this change, calling to hide an alert, leaves a `UIWindow` that blocks user interactions with the screen. The correct way to remove a `UIWindow` in iOS is to set its hidden property to `YES`. Also, it is required to remove all references to the window (the associated `windowScene` for example) and ARC will automatically free this `UIWindow`. The line after this change, set the `_alertWindow` reference to `nil`, but the window is already associated with a scene (see the screenshots from [this PR](#32305 (comment))). So we also need to remove the `windowScene` from that window, as recommended by Apple: https://developer.apple.com/documentation/uikit/uiwindowscene/3198091-windows. >To remove the window from the current scene, or move it to a different scene, change the value of the window's windowScene property. ## Changelog <!-- Help reviewers and the release process by writing your own changelog entry. For an example, see: https://github.com/facebook/react-native/wiki/Changelog --> [iOS] [Fixed] - remove alert's window when call to `hide`. Pull Request resolved: #32833 Test Plan: See #32305 Reviewed By: hramos Differential Revision: D33460430 Pulled By: lunaleaps fbshipit-source-id: b13c2c7ee6404f1e1c787265bc4af8a31005bcf1
This issue was resolved in RN v.67.1. |
Yep, same finding, RN 0.67 fixed this |
Thanks to all involved. That was an interesting journey. |
Closing as this was solved in #32833 |
Please provide all the information requested. Issues that do not follow this format are likely to stall.
Description
Something changed about how UIWindow and the root view controller interact. the
_alertWindow
created in RCTAlertController is no longer removed from the screen when nil'd in- (void) hide
. I suspect that somewhere a retain cycle was introduced by the iOS 15 runtime.React Native version:
Steps To Reproduce
Expected Results
You can interact with the app still
There are no extra windows still on the screen after alert is dismissed
Actual Results
all user interaction is blocked. There is a Window and a UIViewController still on the screen.
The text was updated successfully, but these errors were encountered: