[Android] [adjustResize] Keyboard pushes absolute-positioned dynamic-height component off screen
See original GitHub issueI created a ticket related to the ExNavigator here https://github.com/exponentjs/ex-navigator/issues/105
However I believe this is a core issue.
Currently I am using RN 0.22.2 (on Android)
Basically this is my View
<View style={{flex: 1}}>
<View style={[position: 'absolute', top: 0, left: 0, right: 0, height: 50]}>
</View>
<View style={[position: 'absolute', bottom: 0, left: 0, right: 0, height: 50]}>
<TextInput />
</View>
<View>
This is basically a chat window with an input field positioned at the bottom of the screen and a header positioned at the top of the screen.
When I first open / run the app, Upon focus of the TextInput, the keyboard appears and the View component positioned at the top is pushed off the page.
I spent a day yesterday figuring out why but in the end I used keyboardDidShow and keyboardDidHide to offset the position of the element so it kind of works.
However today I noticed something different. By chance I minimized the App. I didn’t close it. I opened it back up and now the View component that should be positioned at the top was now in the middle. (My offset was calculated to ~270)
So I once again removed the offset handling changes and positioned it statically at the top with top: 0. I then ran the app again by closing and reopening, as expected the View component was once again pushed off the screen when the keyboard appeared.
I minimized the app, then brought it back up. This time when the keyboard appeared, the View component stayed at the top! This is what I am expecting when you open the app the first time, however it only works after minimizing it first.
Definitely seems like a bug to me.
Issue Analytics
- State:
- Created 7 years ago
- Reactions:43
- Comments:59 (6 by maintainers)
Setting
android:windowSoftInputMode="adjustNothing"
on the MainActivity inAndroidManifest.xml
to completely disable the automatic keyboard resizing was my workaround. I then do all the keyboard resizing/scrolling logic myself.android:windowSoftInputMode="adjustPan"
works for me