Skip to content

Commit 963d024

Browse files
authored
fix(ios): prevent usage of viewControllers that are being dismissed (#10291)
1 parent 874f6b6 commit 963d024

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

packages/core/ui/dialogs/index.ios.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,9 @@ function raiseCallback(callback, result) {
4545
}
4646

4747
function showUIAlertController(alertController: UIAlertController) {
48-
let viewController = ios.rootController;
48+
let viewController = ios.rootController as UIViewController;
4949

50-
while (viewController && viewController.presentedViewController) {
50+
while (viewController && viewController.presentedViewController && !viewController.presentedViewController.beingDismissed) {
5151
viewController = viewController.presentedViewController;
5252
}
5353

@@ -60,7 +60,7 @@ function showUIAlertController(alertController: UIAlertController) {
6060
if (alertController.popoverPresentationController) {
6161
alertController.popoverPresentationController.sourceView = viewController.view;
6262
alertController.popoverPresentationController.sourceRect = CGRectMake(viewController.view.bounds.size.width / 2.0, viewController.view.bounds.size.height / 2.0, 1.0, 1.0);
63-
alertController.popoverPresentationController.permittedArrowDirections = 0;
63+
alertController.popoverPresentationController.permittedArrowDirections = 0 as UIPopoverArrowDirection;
6464
}
6565

6666
const color = getButtonColors().color;

0 commit comments

Comments
 (0)