You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
KeyboardAvoidingView Android white area when keyboard open/close #32612
When using KeyboardAvoidingView on android, whatever the configuration I use for the behavior or the keyboardVerticalOffset I always have a white area when the keyboard is opening or closing while on iOS everything is moving smoothly.
Screenrecorder-2021-11-17-13-15-28-66.mp4
In the video, we can see that when the keyboard opens there is a big white area and when closing sometimes a small white rectangle with some flickering. I'm wondering if this is normal behavior because on iOS it transitions smoothly
I tried modifying android manifest with android:windowSoftInputMode="adjustResize" or android:windowSoftInputMode="adjustPan" but the problem is still there with both config.
It would actually be ok if we could change this color from white to something else like the background color of the content (red in my example). But I couldn't find a way.
Version
0.66
Output of react-native info
It happens from the documentation snack so I guess this section is not necessary
Steps to reproduce
Take the example from the KeyboardAvoidingView of react-native documentation and modify the background color of the container from white to red in order to see the white area when opening/closing the keyboard.
Snack, code example, screenshot, or link to a repository
Hi, have you tried to re-build after changing android:windowSoftInputMode: ?
When behavior='height' on Android, following code shows we return initialHeight - bottomHeight.
When keyboard is opening the remaining bottomHeight px area shows up as white blank area.
in KeyboardAvoidingView.js
switch(behavior){case'height':
letheightStyle;if(this._frame!=null&&this.state.bottom>0){// Note that we only apply a height change when there is keyboard present,// i.e. this.state.bottom is greater than 0. If we remove that condition,// this.frame.height will never go back to its original value.// When height changes, we need to disable flex.heightStyle={height: this._initialFrameHeight-bottomHeight,flex: 0,};}return(<Viewref={this.viewRef}style={StyleSheet.compose(style,heightStyle)}onLayout={this._onLayout}{...props}>{children}</View>);
If you are using Expo there is a solution.
For me it worked setting the android:windowSoftInputMode="adjustPan" but doing so in the expo app.config.json setting the
@Nantris Well, I went back to the Expo Snack and tried Expo Go on my Android 15 device, and I'm still seeing the problem that was reported when the keyboard jumps—there's a white background on a white background
Activity
turker0 commentedon Nov 22, 2021
Hi, have you tried to re-build after changing
android:windowSoftInputMode:?When
behavior='height'on Android, following code shows we returninitialHeight - bottomHeight.When keyboard is opening the remaining bottomHeight px area shows up as white blank area.
in KeyboardAvoidingView.js
kabus202 commentedon Jan 23, 2022
I have the same. Did you find any solution @Nazort ??
HrithikMittal commentedon Aug 18, 2022
I also face the same issue and haven't find any good solution for this
KubaKubikula commentedon Oct 14, 2022
same here
omri81 commentedon Mar 6, 2023
facing the same issue anyone has a solution?
JaLe29 commentedon Jun 10, 2023
same, no solution
apatozi commentedon Jun 22, 2023
If you are using Expo there is a solution.
For me it worked setting the android:windowSoftInputMode="adjustPan" but doing so in the expo app.config.json setting the
and after that Using the <KeyboardAvoidingView behaviour={'padding'} /> for both Android and iOS and have the same result.
playsoremobile commentedon Oct 7, 2023
Did you find any solution?
I'm facing the same issue.
Polad10 commentedon Jan 15, 2024
+1
11 remaining items
abrahamgalue commentedon Oct 9, 2025
The problem persists
Nantris commentedon Oct 9, 2025
@abrahamgalue on what Android version? I think this is an Android problem with React Native and it seems resolved on newer versions of Android.
abrahamgalue commentedon Oct 9, 2025
@Nantris Well, I went back to the Expo Snack and tried Expo Go on my Android 15 device, and I'm still seeing the problem that was reported when the keyboard jumps—there's a white background on a white background
Nantris commentedon Oct 9, 2025
I don't know if Expo Go is a valid test for this.
Try this to set the background color of the native root component (I guess is what this does) and make a custom dev client build and if you still see it then it's definitely still an issue: https://docs.expo.dev/versions/latest/sdk/system-ui/#systemuisetbackgroundcolorasynccolor
abrahamgalue commentedon Oct 10, 2025
@Nantris Yes, that works. Although I can't stop thinking about how a developer who doesn't use Expo, only React Native as a library, would do it.
Nantris commentedon Oct 10, 2025
Glad to hear it!
I think these are the underlying native functions:
https://github.com/expo/expo/blob/27b2a908664cc5521961a65709dcb8c7e03e54ec/packages/expo-system-ui/ios/ExpoSystemUI/ExpoSystemUIModule.swift#L42
https://github.com/expo/expo/blob/27b2a908664cc5521961a65709dcb8c7e03e54ec/packages/expo-system-ui/android/src/main/java/expo/modules/systemui/SystemUIModule.kt#L40
react-native-bot commentedon Apr 9, 2026
This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 7 days.
react-native-bot commentedon Oct 8, 2026
This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 7 days.
react-native-bot commentedon Oct 15, 2026
This issue was closed because it has been stalled for 7 days with no activity.