diff --git a/patches/react-native+0.75.2+018+android-keyboard-avoiding-view.patch b/patches/react-native+0.75.2+018+android-keyboard-avoiding-view.patch new file mode 100644 index 0000000000000..27fa6074e6ce5 --- /dev/null +++ b/patches/react-native+0.75.2+018+android-keyboard-avoiding-view.patch @@ -0,0 +1,26 @@ +diff --git a/node_modules/react-native/ReactAndroid/src/main/java/com/facebook/react/ReactRootView.java b/node_modules/react-native/ReactAndroid/src/main/java/com/facebook/react/ReactRootView.java +index ed1aba8..0a9284f 100644 +--- a/node_modules/react-native/ReactAndroid/src/main/java/com/facebook/react/ReactRootView.java ++++ b/node_modules/react-native/ReactAndroid/src/main/java/com/facebook/react/ReactRootView.java +@@ -891,7 +891,9 @@ public class ReactRootView extends FrameLayout implements RootView, ReactRoot { + sendEvent( + "keyboardDidHide", + createKeyboardEventPayload( +- PixelUtil.toDIPFromPixel(mVisibleViewArea.height()), ++ // Use mLastHeight to account for the translucent status bar, and fall back to getMeasuredHeight() on Bridgeless mode. ++ // Remove this patch once the upstream fix for https://github.com/facebook/react-native/issues/47140 is released. ++ PixelUtil.toDIPFromPixel(mWasMeasured ? mLastHeight : getMeasuredHeight()), + 0, + PixelUtil.toDIPFromPixel(mVisibleViewArea.width()), + 0)); +@@ -940,7 +942,9 @@ public class ReactRootView extends FrameLayout implements RootView, ReactRoot { + sendEvent( + "keyboardDidHide", + createKeyboardEventPayload( +- PixelUtil.toDIPFromPixel(mVisibleViewArea.height()), ++ // Use mLastHeight to account for the translucent status bar, and fall back to getMeasuredHeight() on Bridgeless mode. ++ // Remove this patch once the upstream fix for https://github.com/facebook/react-native/issues/47140 is released. ++ PixelUtil.toDIPFromPixel(mWasMeasured ? mLastHeight : getMeasuredHeight()), + 0, + PixelUtil.toDIPFromPixel(mVisibleViewArea.width()), + 0));