ionic-team / ionic-team/capacitor-keyboard

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

Open
#21 3 comments 7 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
3
Forks
21
PR merge metrics
No merged PRs in 30d

Description

## 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:
- Android 10 + downgrading to v5 of capacitor-keyboard
- soft input mode adjustPan on newer Android devices (tested on Android 14)
- soft input mode adjustResize

### 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.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.