diff --git a/CHANGELOG.md b/CHANGELOG.md index 9270d9cc..868e8cab 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ ### 🐛 Bug fixes +- **iOS**: Navigating to a modal screen while the sheet is dismissing now opens the modal once the sheet is gone. With the patched `react-native-screens`, the modal never opened and no other modal could open until the app restarted. ([#1019](https://github.com/lodev09/react-native-true-sheet/pull/1019) by [@JacquesLeupin](https://github.com/JacquesLeupin)) - **Android**: A sheet whose keyboard starts rising as the present slide ends, such as one that focuses an input around `onWillPresent`, now finishes presenting. It used to never fire `onDidPresent` or resolve `present()`, and kept swallowing taps. ([#1012](https://github.com/lodev09/react-native-true-sheet/pull/1012) by [@JacquesLeupin](https://github.com/JacquesLeupin)) - **Android**: When a sheet presented over another sheet changes its content size right before it dismisses, the sheet behind it now slides back instead of staying pushed down and not draggable. ([#1015](https://github.com/lodev09/react-native-true-sheet/pull/1015) by [@idlework](https://github.com/idlework)) - **Android**: The keyboard no longer counts against `maxContentHeight`, as on iOS. A sheet now rises above the keyboard instead of stopping at `maxContentHeight` with the keyboard covering the bottom of its content, such as a button below a text input. A sheet already at `maxContentHeight` now rises with the keyboard too, instead of staying put. ([#1017](https://github.com/lodev09/react-native-true-sheet/pull/1017) by [@wildseansy](https://github.com/wildseansy)) diff --git a/ios/TrueSheetViewController.mm b/ios/TrueSheetViewController.mm index 5041ef8f..934afe4f 100644 --- a/ios/TrueSheetViewController.mm +++ b/ios/TrueSheetViewController.mm @@ -2345,6 +2345,12 @@ - (BOOL)isDismissible { } - (UIViewController *)newPresentingViewController { + // A dismissing sheet can't present, and react-native-screens stops updating its modals when handed one. + // Returning nil makes it present from its own controller, which UIKit queues until this dismissal ends. + if (self.isBeingDismissed) { + return nil; + } + UIViewController *topmost = self; while (topmost.presentedViewController != nil && !topmost.presentedViewController.isBeingDismissed && [topmost.presentedViewController isKindOfClass:[TrueSheetViewController class]]) {