From 60ac4e7a05c9e627eb9fc7a1bdf004c7fca99817 Mon Sep 17 00:00:00 2001 From: Shailesh Lolam Date: Tue, 19 Nov 2019 07:36:08 -0700 Subject: [PATCH] fix(iOS): Opening alert/confirm on top most of modal dialogs (#7982) This is fix for the issue #6939 where alert() and confirm() does not work in a modal dialog if it's opened on top of an existing modal dialog. --- nativescript-core/ui/dialogs/dialogs.ios.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/nativescript-core/ui/dialogs/dialogs.ios.ts b/nativescript-core/ui/dialogs/dialogs.ios.ts index d8276adeb..f7eb1dbe6 100644 --- a/nativescript-core/ui/dialogs/dialogs.ios.ts +++ b/nativescript-core/ui/dialogs/dialogs.ios.ts @@ -205,6 +205,11 @@ function showUIAlertController(alertController: UIAlertController) { if (currentView) { currentView = currentView.modal || currentView; + //get to the top most view controller on the stack + while (currentView && currentView.modal) { + currentView = currentView.modal; + } + let viewController: UIViewController = currentView.ios; if (viewController.presentedViewController) {