-
Notifications
You must be signed in to change notification settings - Fork 24.4k
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): remove alert's window when call to hide
.
#32833
Conversation
2084c55
to
85fa844
Compare
Base commit: 681ed40 |
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>
85fa844
to
3767095
Compare
Base commit: 681ed40 |
Thanks, that looks like a good addition! |
Thanks @paddlefish! @lunaleaps, can you please take a look at this change? We will also appreciate if it can be pushed as a patch-release for RN v.66. 🙏🏼 |
Does this mean we're dropping #32305 for this change? |
Yes @lunaleaps |
@lunaleaps has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
Just FYI for me and anyone watching this -- some ongoing discussion still happening on old PR: #32305 (comment) |
@lunaleaps @philIip I would greatly appreciate if we could move faster with this bug fix. I believe that adding the |
Hey @philIip @lunaleaps, is there anything that blocks us from merging this bug fix? |
I got internal approval, will be landing this later today or tomorrow. |
This pull request was successfully merged by @asafkorem in a46a99e. When will my fix make it into a release? | Upcoming Releases |
Thanks @lunaleaps! 🙂 |
@lunaleaps Are you planning on releasing it in a patch-release soon? (we would greatly appreciate it!) |
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 toYES
. Also, it is required to remove all references to the window (the associatedwindowScene
for example) and ARC will automatically free thisUIWindow
.The line after this change, set the
_alertWindow
reference tonil
, but the window is already associated with a scene (see the screenshots from this PR). So we also need to remove thewindowScene
from that window, as recommended by Apple: https://developer.apple.com/documentation/uikit/uiwindowscene/3198091-windows.Changelog
[iOS] [Fixed] - remove alert's window when call to
hide
.Test Plan
See #32305