ionic-team / capacitor-plugins

Official plugins for Capacitor ⚡️
504 stars 575 forks source link

@capacitor/keyboard v6 stopped working for windowSoftInputMode="adjustPan" on older SDKs #2158

Open chriswep opened 1 month ago

chriswep commented 1 month ago

Bug Report

Keyboard listeners don't fire on Android <= 10 devices when android:windowSoftInputMode="adjustPan" is set. Changing the input mode to adjustResize makes the listeners work again, however we used adjustPan since it allowed us to get the keyboardHeight without the webivew being resized. Looking at the diff (https://github.com/ionic-team/capacitor-plugins/commit/c4f916521b1d14bfb2ddac651b1fdc33e4c29884) it seems that the implmentation was basically replaced completely. Something about the new implmentation made it stop working for the adjustPan mode on older Android sdks.

What is working:

Plugin(s)

@capacitor/keyboard

Capacitor Version

6

Platform(s)

Android

Current Behavior

No keyboard events are dispatched when android:windowSoftInputMode="adjustPan" is set on the activity on older SDKs. Tested on SDK 29 Emulator and Android 10 real device. Android 14 does work with "adjustPan": keyboard events are dispatched, including correct keyboardHeight.

Expected Behavior

Keyboard events are dispatched when using "adjustPan" and older (supported) devices - like it did with V5.

Code Reproduction

Set android:windowSoftInputMode="adjustPan" on the main activity and test with an SDK 29 emulator. No keyboard events are dispatched.

Ionitron commented 1 month ago

This issue needs more information before it can be addressed. In particular, the reporter needs to provide a minimal sample app that demonstrates the issue. If no sample app is provided within 15 days, the issue will be closed.

Please see the Contributing Guide for how to create a Sample App.

Thanks! Ionitron 💙

chriswep commented 1 month ago

here you go: https://github.com/chriswep/cap6-keyboard-adjustpan-android10

chriswep commented 1 month ago

if you want you can downgrade the keyboard plugin to v5 and see that the event will be captured on both SDKs.