I’ve been trying to use Gifted Chat in my Expo app. I noticed that, when running on Android and tapping the text input on the chat control, the keyboard appears and covers the text input and part of the conversation- the chat UI doesn’t move to the top half of the screen as one would expect. This is despite Expo’s AndroidManifest.xml having the android:windowSoftInputMode="adjustResize"
that is required to use the library with Android.
I created a test project to demonstrate the issue: GitHub - keith-kurak/expo-gifted-chat-example: Demo of Gifted Chat using Expo to see how it works in Android
Steps to reproduce:
- (assuming you’ve downloaded repo and installed dependencies, etc) Run the app in Expo on an Android device.
- Tap the text box that appears at the bottom of the screen.
- You’ll see the text box is covered.
I think I figured out what is wrong (as this doesn’t happen on a stock RN app), but not sure if what fixes it has side effects.
To “fix”:
- Detach from Expo
- In android/app/src/main/res/values/styles.xml, delete
<item name="android:windowTranslucentStatus" tools:targetApi="19">true</item>
under the Theme.Exponent.Light theme. - Run the app in Android.
- The rest of the view will move up (or really, resize) when the text box is tapped and the keyboard opens.
Along with Gifted Chat, it seems like this would cause any other apps that rely on this soft keyboard resizing behavior to have problems. It’d be great to have the Theme.Exponent.Light theme fixed so it supports the adjustResize mode.
EDITED: for clarity- an errant apostrophe removed an entire code snippet.