capacitor-extended-dialog 0.0.2 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -489,9 +489,18 @@ public struct DialogStyleOptions {
489
489
  }
490
490
 
491
491
  while let presentedViewController = topController.presentedViewController {
492
+ // Skip view controllers that are being dismissed or not in window hierarchy
493
+ if presentedViewController.isBeingDismissed || presentedViewController.view.window == nil {
494
+ break
495
+ }
492
496
  topController = presentedViewController
493
497
  }
494
498
 
499
+ // If the top controller is being dismissed or not in window, fall back to root
500
+ if topController.isBeingDismissed || topController.view.window == nil {
501
+ return window.rootViewController
502
+ }
503
+
495
504
  return topController
496
505
  }
497
506
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "capacitor-extended-dialog",
3
- "version": "0.0.2",
3
+ "version": "0.0.3",
4
4
  "description": "Show native dialogs in Capacitor with Material 3 and Liquid Glass UI",
5
5
  "main": "dist/plugin.cjs.js",
6
6
  "module": "dist/esm/index.js",