Skip to content

Keyboard resize not applying when switching to emoji keyboard #2363

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
mrfelfel opened this issue May 9, 2025 · 0 comments
Open

Keyboard resize not applying when switching to emoji keyboard #2363

mrfelfel opened this issue May 9, 2025 · 0 comments

Comments

@mrfelfel
Copy link

mrfelfel commented May 9, 2025

Bug Report

Plugin(s)

@capacitor/keyboard: ^7.0.1

Capacitor Version

7.2.0

Platform(s)

  • Android

Current Behavior

When switching from the regular keyboard to the emoji keyboard, the WebView does not resize automatically to adjust to the new keyboard height. This issue does not occur in Capacitor v6, where the resizing worked correctly even when switching between the regular keyboard and the emoji keyboard. The adjustResize mode in AndroidManifest.xml is set, but resizing does not occur when the emoji keyboard is shown.

Expected Behavior

The WebView should automatically resize whenever the keyboard type switches (e.g., from the regular keyboard to the emoji keyboard), just like it did in Capacitor v6. The content should reflow correctly, and there should be no overflow or layout issues when the keyboard shows or switches.

Code Reproduction

This issue can be reproduced in any WebView-based Capacitor 7 app by focusing on an input field and switching between the regular keyboard and the emoji keyboard.

Steps to reproduce:

  1. Open a WebView-based app on Android.
  2. Focus on an input field to bring up the system keyboard.
  3. Switch from the regular keyboard to the emoji keyboard.
  4. Observe that the content in the WebView does not resize, causing layout issues.

Other Technical Details

  • Capacitor version: 7.0.1
  • Android version: Test on Android 14 or later.
  • WebView-based app.
  • windowSoftInputMode="adjustResize" is set in AndroidManifest.xml.

Additional Context

  • The issue was not present in Capacitor v6, where resizing occurred as expected when switching keyboard types.
  • It seems that the resize event is not triggered when switching to the emoji keyboard, possibly due to a regression in how Capacitor 7 handles keyboard changes.
  • A possible fix could involve manually handling the keyboard resize events by using a native listener (such as OnGlobalLayoutListener) and adjusting the WebView content accordingly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants