@lodev09/react-native-true-sheet 3.0.2 → 3.0.4
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.
package/ios/TrueSheetView.mm
CHANGED
|
@@ -471,12 +471,12 @@ using namespace facebook::react;
|
|
|
471
471
|
if (!rootViewController)
|
|
472
472
|
return nil;
|
|
473
473
|
|
|
474
|
-
// Find topmost presented view controller
|
|
474
|
+
// Find topmost presented view controller that is not being dismissed
|
|
475
475
|
while (rootViewController.presentedViewController) {
|
|
476
476
|
UIViewController *presented = rootViewController.presentedViewController;
|
|
477
477
|
|
|
478
|
-
// Skip
|
|
479
|
-
if (
|
|
478
|
+
// Skip any view controller that is being dismissed
|
|
479
|
+
if (presented.isBeingDismissed) {
|
|
480
480
|
break;
|
|
481
481
|
}
|
|
482
482
|
rootViewController = presented;
|
|
@@ -759,8 +759,14 @@
|
|
|
759
759
|
}
|
|
760
760
|
|
|
761
761
|
- (UIViewController *)newPresentingViewController {
|
|
762
|
-
//
|
|
763
|
-
|
|
762
|
+
// Find the topmost TrueSheetViewController in the chain
|
|
763
|
+
// This handles cases where this sheet is presenting another sheet (child sheet)
|
|
764
|
+
UIViewController *topmost = self;
|
|
765
|
+
while (topmost.presentedViewController != nil && !topmost.presentedViewController.isBeingDismissed &&
|
|
766
|
+
[topmost.presentedViewController isKindOfClass:[TrueSheetViewController class]]) {
|
|
767
|
+
topmost = topmost.presentedViewController;
|
|
768
|
+
}
|
|
769
|
+
return topmost;
|
|
764
770
|
}
|
|
765
771
|
#endif
|
|
766
772
|
|
package/package.json
CHANGED