From 659505a963e322df4326d6f006458941d7bf742c Mon Sep 17 00:00:00 2001 From: airtelshivam <102032927+airtelshivam@users.noreply.github.com> Date: Mon, 2 Sep 2024 19:39:29 +0530 Subject: [PATCH] Update KeyboardAvoidingView.js https://github.com/facebook/react-native/issues/29974 KeyboardAvoidingView collapses to 0 height on iOS14 when "Prefer Cross-Fade Transitions" is enabled --- Libraries/Components/Keyboard/KeyboardAvoidingView.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Libraries/Components/Keyboard/KeyboardAvoidingView.js b/Libraries/Components/Keyboard/KeyboardAvoidingView.js index 4536402c5104f6..f79a8dc7022824 100644 --- a/Libraries/Components/Keyboard/KeyboardAvoidingView.js +++ b/Libraries/Components/Keyboard/KeyboardAvoidingView.js @@ -73,8 +73,10 @@ class KeyboardAvoidingView extends React.Component { _relativeKeyboardHeight(keyboardFrame: KeyboardEventCoordinates): number { const frame = this._frame; - if (!frame || !keyboardFrame) { - return 0; + // with iOS 14 & Reduce Motion > Prefer Cross-Fade Transitions enabled, the keyboard position + // & height is reported differently (0 instead of Y position value matching height of frame) + if (!frame || !keyboardFrame || keyboardFrame.screenY === 0) { + return 0; } const keyboardY =