mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-02-09 17:13:46 +08:00
Fix showing alerts when modals are presented
Reviewed By: nicklockwood Differential Revision: D2638505 fb-gh-sync-id: ebecc82baa46be4302fc8d3231f859de572eda10
This commit is contained in:
committed by
facebook-github-bot-2
parent
5931089677
commit
51a5b60a1a
@@ -95,6 +95,12 @@ RCT_EXPORT_METHOD(alertWithArgs:(NSDictionary *)args
|
||||
return;
|
||||
}
|
||||
|
||||
// Walk the chain up to get the topmost modal view controller. If modals are presented,
|
||||
// the root view controller's view might not be in the window hierarchy, and presenting from it will fail.
|
||||
while (presentingController.presentedViewController) {
|
||||
presentingController = presentingController.presentedViewController;
|
||||
}
|
||||
|
||||
#if __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_8_0
|
||||
|
||||
if ([UIAlertController class] == nil) {
|
||||
|
||||
Reference in New Issue
Block a user