-
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 #51307 from QichenZhu/fix/48100
Fix KeyboardAvoidingView padding on Android
- Loading branch information
Showing
1 changed file
with
26 additions
and
0 deletions.
There are no files selected for viewing
26 changes: 26 additions & 0 deletions
26
patches/react-native+0.75.2+018+android-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,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)); |