Open chriswep opened 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 💙
here you go: https://github.com/chriswep/cap6-keyboard-adjustpan-android10
if you want you can downgrade the keyboard plugin to v5 and see that the event will be captured on both SDKs.
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.