diff --git a/packages/react-native/Libraries/Components/Keyboard/KeyboardAvoidingView.js b/packages/react-native/Libraries/Components/Keyboard/KeyboardAvoidingView.js index 9fb5637c6c59b7..db89a91ab9ee70 100644 --- a/packages/react-native/Libraries/Components/Keyboard/KeyboardAvoidingView.js +++ b/packages/react-native/Libraries/Components/Keyboard/KeyboardAvoidingView.js @@ -112,14 +112,15 @@ class KeyboardAvoidingView extends React.Component { }; _onLayout = async (event: ViewLayoutEvent) => { - const wasFrameNull = this._frame == null; + const oldFrame = this._frame; this._frame = event.nativeEvent.layout; if (!this._initialFrameHeight) { // save the initial frame height, before the keyboard is visible this._initialFrameHeight = this._frame.height; } - if (wasFrameNull) { + // update bottom height for the first time or when the height is changed + if (!oldFrame || oldFrame.height !== this._frame.height) { await this._updateBottomIfNecessary(); }