-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #51509 from QichenZhu/fix/48677
Fix KeyboardAvoidingView not aware of the keyboard closing after it is unmounted
- Loading branch information
Showing
1 changed file
with
18 additions
and
0 deletions.
There are no files selected for viewing
18 changes: 18 additions & 0 deletions
18
patches/react-native+0.75.2+020+keyboard-avoiding-view.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
diff --git a/node_modules/react-native/Libraries/Components/Keyboard/KeyboardAvoidingView.js b/node_modules/react-native/Libraries/Components/Keyboard/KeyboardAvoidingView.js | ||
index e26d677..597be5a 100644 | ||
--- a/node_modules/react-native/Libraries/Components/Keyboard/KeyboardAvoidingView.js | ||
+++ b/node_modules/react-native/Libraries/Components/Keyboard/KeyboardAvoidingView.js | ||
@@ -175,6 +175,13 @@ class KeyboardAvoidingView extends React.Component<Props, State> { | ||
} | ||
|
||
componentDidMount(): void { | ||
+ // Fix KeyboardAvoidingView not aware of the keyboard closing after it is unmounted. | ||
+ // Remove this patch after the upstream fix https://github.com/facebook/react-native/commit/08bd8ac47da60121225e7b281bbf566e2c5a291e is released. | ||
+ if (!Keyboard.isVisible()) { | ||
+ this._keyboardEvent = null; | ||
+ this._setBottom(0); | ||
+ } | ||
+ | ||
if (Platform.OS === 'ios') { | ||
this._subscriptions = [ | ||
Keyboard.addListener('keyboardWillChangeFrame', this._onKeyboardChange), |