KeyboardAvoidingView doesn’t reset properly after closing the keyboard in landscape mode #50444
Labels
API: Keyboard
Component: KeyboardAvoidingView
Issue: Author Provided Repro
This issue can be reproduced in Snack or an attached project.
Newer Patch Available
Description
When using KeyboardAvoidingView, if you:
Rotate the device to landscape mode.
Open the keyboard.
Close the keyboard.
Rotate back to portrait mode.
Result: The lower part of the screen becomes white and unresponsive.
Expected Behavior
The layout should reset correctly after closing the keyboard.
No blank space should remain after switching back to portrait mode.
Steps to reproduce
Run this code in a React Native project.
Rotate the device to landscape mode.
Open and then close the keyboard.
Rotate back to portrait mode.
Observe that part of the screen turns white and the layout does not reset properly.
{
"name": "StatusBarApp",
"version": "0.0.1",
"private": true,
"scripts": {
"android": "react-native run-android",
"ios": "react-native run-ios",
"lint": "eslint .",
"start": "react-native start",
"test": "jest"
},
"dependencies": {
"react": "19.0.0",
"react-native": "0.78.1"
},
"devDependencies": {
"@babel/core": "^7.25.2",
"@babel/preset-env": "^7.25.3",
"@babel/runtime": "^7.25.0",
"@react-native-community/cli": "15.0.1",
"@react-native-community/cli-platform-android": "15.0.1",
"@react-native-community/cli-platform-ios": "15.0.1",
"@react-native/babel-preset": "0.78.1",
"@react-native/eslint-config": "0.78.1",
"@react-native/metro-config": "0.78.1",
"@react-native/typescript-config": "0.78.1",
"@types/jest": "^29.5.13",
"@types/react": "^19.0.0",
"@types/react-test-renderer": "^19.0.0",
"eslint": "^8.19.0",
"jest": "^29.6.3",
"prettier": "2.8.8",
"react-test-renderer": "19.0.0",
"typescript": "5.0.4"
},
"engines": {
"node": ">=18"
}
}
React Native Version
0.78.1
Affected Platforms
Runtime - Android
Output of
npx @react-native-community/cli info
Stacktrace or Logs
Reproducer
https://snack.expo.dev/b_19gzvJALVnCDLyurUTS
Screenshots and Videos
The text was updated successfully, but these errors were encountered: