-
Notifications
You must be signed in to change notification settings - Fork 24.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
KeyboardAvoidingView
infinitely updates on Android
#45192
Comments
Hmm, I don't know if this is somehow connected, but after upgrading from 0.73^ to 0.74^, the windowSoftInputMode / KeyboardAvoidingView has stopped working correctly on Android: RN 0.73^ 3b561391-ed1f-4f8a-a8c7-8cf85396f44a.movRN 0.74^ a3964de7-7a76-48b7-90bf-2bc3c927a129.movLooks like serious issue, but need more time to make clean repro. |
This is an issue for our app also - the fact that the Android keyboard seems to have a continuously-changing height. This is causing a custom Modal that we have in our app which repositions itself based upon a combination of the height of the keyboard and whether it is visible. Works fine on iOS (because the keyboard height is constant). But, because the Android keyboard height constantly changes, our app crashes with this error:
This is an excerpt of the code we are using to track the keyboard height so we can reposition the modal (by kicking off an animation on the bottom margin of the modal to matching the height of the keyboard, or 0 if the keyboard is not visible).
|
Sorry - I forgot to mention that the issue might be with the actual height of the Keyboard changing as opposed to the KeyboardAvoidingView component, if that helps at all. |
I also encountered the same problem on 0.75.3.It makes the bottom of my screen flicker :( |
Description
The bottom state of the
KeyboardAvoidingView
component infinitely updates on Android. This is visible when inspectingKeyboardAvoidingView
's state in React Native DevTools, it continuously changes value. Or when a component is rendered just above the keyboard, it flickers and/or bounces up and down.Steps to reproduce
Prerequisites
example-1
. Reproduction 2 is on branchexample-2
. For each branch, checkout,yarn install
thenyarn android
.Reproduction 1
Reproduction 1 is a text input and footer fixed to the bottom wrapped in a
KeyboardAvoidingView
. While the bottom state changes, the change is so small (<1 px) that it is not noticeable in the UI.Steps
KeyboardAvoidingView
in the React Native DevTools.bottom
state in DevTools.bottom
state in DevTools.Expected behaviour
The
bottom
state should not continuously change.Actual behaviour
The
bottom
state continuously changes.Reproduction 2
Reproduction 2 is the same as reproduction 1 but with two screens to show the effect on the UI as the bottom state change is much larger.
Steps
Screen2
'sKeyboardAvoidingView
in the React Native DevTools.Expected behaviour
The
bottom
state should not continuously change. The footer should not be flickering.Actual behaviour
The
bottom
state continuously changes. The footer is flickering.React Native Version
0.74.2
Affected Platforms
Runtime - Android
Output of
npx react-native info
Stacktrace or Logs
Reproducer
https://github.com/winghouchan/react-native-keyboardavoidingview-infinite-update-mcve
Screenshots and Videos
Reproduction 1
react-native-keyboardavoidingview-infinite-update-mcve-1_1080p.mov
Reproduction 2
react-native-keyboardavoidingview-infinite-update-mcve-2_720p.mov
The text was updated successfully, but these errors were encountered: