bug: Android windowSoftInputMode:adjustPan not working
See original GitHub issueBug Report
Capacitor Version
💊 Capacitor Doctor 💊
Latest Dependencies:
@capacitor/cli: 3.3.2
@capacitor/core: 3.3.2
@capacitor/android: 3.3.2
@capacitor/ios: 3.3.2
Installed Dependencies:
@capacitor/core: 3.2.5
@capacitor/android: 3.2.5
@capacitor/ios: 3.2.5
@capacitor/cli: 3.2.5
[success] iOS looking great! 👌
[success] Android looking great! 👌
Platform(s)
android
Current Behavior
windowSoftInputMode:adjustPan
not working in android
Expected Behavior
I think that setting up adjustPan would work like ios, but it actually works like adjustNothing.
Code Reproduction
I add adjustPan setting to AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.xxx.yyy">
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="${displayName}"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|smallestScreenSize|screenLayout|uiMode"
android:name="com.xxx.yyy.MainActivity"
android:label="${displayName}"
android:theme="@style/AppTheme.NoActionBarLaunch"
android:launchMode="singleTask"
android:windowSoftInputMode="adjustPan"
android:hardwareAccelerated="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<provider
android:name="androidx.core.content.FileProvider"
android:authorities="${applicationId}.fileprovider"
android:exported="false"
android:grantUriPermissions="true">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/file_paths"></meta-data>
</provider>
</application>
<!-- Permissions -->
<uses-permission android:name="android.permission.INTERNET" />
</manifest>
Other Technical Details
npm --version
output: 8.0.0
node --version
output: v12.8.2
pod --version
output (iOS issues only):
Additional Context
Issue Analytics
- State:
- Created 2 years ago
- Comments:8 (4 by maintainers)
Top Results From Across the Web
android:windowSoftInputMode="adjustPan" is not working
Now the problems are coming inspite of using android:windowSoftInputMode="adjustPan" android Lollipop theme and toolbar,.
Read more >SoftInput.AdjustPan Not Working in Landscape - Microsoft Q&A
In the Activity attribute of my MainActivity class I include WindowSoftInputMode = SoftInput.AdjustPan, and I do not attempt to change this ...
Read more >Issue with adjustPan and adjustResize how to put ... - YouTube
If you have encountered issues with adjustPan / adjustResize you can ... Android Tutorial - Issue with adjustPan and adjustResize how to put ......
Read more >Android : windowSoftInputMode="adjustResize" not working ...
Android : windowSoftInputMode =" adjustResize " not working with translucent action/navbar [ Beautify Your Computer ...
Read more >Handle input method visibility | Android Developers
<application ... > <activity android:windowSoftInputMode="adjustResize" ... >
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks for the app.
I’ve been able to reproduce, but with the same app content, the behavior is the same if I put it in a Cordova app and even in a native app that just contains a WebView (with no Cordova or Capacitor involvement), so it looks like a bug on the WebView itself, not in Capacitor.
If in the native app I put some native edit text fields it scrolls properly to them, but doesn’t work with web input fields.
If I remove the
windowSoftInputMode
or set it toadjustResize
then it focus properly, but resizing the content a bit. If you don’t want that behavior you’ll have to use the keyboard plugin for listening for the show/hide events and scroll to the inputs yourself.Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Capacitor, please create a new issue and ensure the template is fully filled out.