When I set the softwareKeyboardLayoutMode to “pan” in app.json → android, it works well in Expo Go and when I do a normal expo build:android
. But, when I build with eas build -p android
it doesn’t work. My bottom elements are pushed at the top of the keyboard like if it was in “resize” mode.
hi! it looks like the config plugin to support this is missing. we’ll likely add this soon, but in the meantime you can write your own config plugin to make this change. you’ll have to set android:windowSoftInputMode="adjustPan"
on your MainActivity in AndroidManifest.xml
Thanks for the response. My app is managed I don’t have this file currently
The config plugin will allow you to update that during the build process. As it says in the Config Plugins docs:
See also this part of the docs:
Modifying the AndroidManifest.xml
got it thank you.
import { ExpoConfig } from "@expo/config-types";
import { AndroidConfig, ConfigPlugin, withAndroidManifest } from "@expo/config-plugins";
const withKeyboardPanAndroid: ConfigPlugin = (config) => {
const { getMainActivityOrThrow } = AndroidConfig.Manifest;
return withAndroidManifest(config, async (config) => {
const mainActivity = getMainActivityOrThrow(config.modResults);
mainActivity.$["android:windowSoftInputMode"] = "adjustPan";
return config;
});
};
Does it work?
Yes, it would be a temporary fix for now. I’ll wait for the EAS fix
1 Like
this is deployed to eas now with the update to expo-cli@4.9.1