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 disappearing alert bug on iOS #26839

Closed
wants to merge 3 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 3 additions & 9 deletions React/Modules/RCTAlertManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -91,16 +91,10 @@ - (void)invalidate
}
}

CGSize screenSize = [UIScreen mainScreen].bounds.size;
self->_window = [[UIWindow alloc] initWithFrame:CGRectMake(0, 0, screenSize.width, screenSize.height)];
#if TARGET_OS_TV
self->_window.windowLevel = UIWindowLevelNormal + 1;
#else
self->_window.windowLevel = UIWindowLevelStatusBar + 1;
#endif
_window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
_window.windowLevel = UIWindowLevelStatusBar + 1;
UIViewController *presentingController = [UIViewController new];
self->_window.rootViewController = presentingController;
self->_window.hidden = NO;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hidden must be set to NO explicitly, otherwise the window will remain invisible

_window.rootViewController = presentingController;

UIAlertController *alertController = [UIAlertController
alertControllerWithTitle:title
Expand Down