From 688601d1fbeec22952c657150f75d0cf85637ba5 Mon Sep 17 00:00:00 2001 From: RyosukeCla Date: Tue, 4 Jun 2024 16:53:19 +0900 Subject: [PATCH] Dismiss modal view controller in ModalRootViewController --- ios/Nativebrik/Nativebrik/component/root.swift | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ios/Nativebrik/Nativebrik/component/root.swift b/ios/Nativebrik/Nativebrik/component/root.swift index bc82bba..9df80fb 100644 --- a/ios/Nativebrik/Nativebrik/component/root.swift +++ b/ios/Nativebrik/Nativebrik/component/root.swift @@ -22,6 +22,7 @@ class ModalRootViewController: UIViewController { return page.data?.kind == PageKind.TRIGGER } self.modalViewController = modalViewController + self.modalViewController?.dismissModal() self.container = container super.init(nibName: nil, bundle: nil) @@ -235,6 +236,9 @@ class RootView: UIView { func findTopPresenting(_ viewContorller: UIViewController) -> UIViewController { if let presented = viewContorller.presentedViewController { + if presented.isBeingDismissed { + return viewContorller + } return findTopPresenting(presented) } else { return viewContorller