forked from Expensify/App
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathreact-native+0.73.4+001+initial.patch
18 lines (18 loc) · 1.29 KB
/
react-native+0.73.4+001+initial.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
diff --git a/node_modules/react-native/React/Views/RCTModalHostViewManager.m b/node_modules/react-native/React/Views/RCTModalHostViewManager.m
index 4b9f9ad..b72984c 100644
--- a/node_modules/react-native/React/Views/RCTModalHostViewManager.m
+++ b/node_modules/react-native/React/Views/RCTModalHostViewManager.m
@@ -79,6 +79,13 @@ - (void)presentModalHostView:(RCTModalHostView *)modalHostView
if (self->_presentationBlock) {
self->_presentationBlock([modalHostView reactViewController], viewController, animated, completionBlock);
} else {
+ // In our App, If an input is blurred and a modal is opened, the rootView will become the firstResponder, which
+ // will cause system to retain a wrong keyboard state, and then the keyboard to flicker when the modal is closed.
+ // We first resign the rootView to avoid this problem.
+ UIWindow *window = RCTKeyWindow();
+ if (window && window.rootViewController && [window.rootViewController.view isFirstResponder]) {
+ [window.rootViewController.view resignFirstResponder];
+ }
[[modalHostView reactViewController] presentViewController:viewController
animated:animated
completion:completionBlock];