ionic-team / capacitor-plugins

Official plugins for Capacitor ⚡️
523 stars 587 forks source link

Capacitor Keyboard height incorrect in Capacitor 6 #2168

Open xanather opened 2 months ago

xanather commented 2 months ago

Bug Report

Plugin(s)

Capacitor Keyboard

Capacitor Version

6+

Affected Platform(s)

Android all versions, for older versions (Android 9) the bug is even more severe where no keyboard callbacks are made when windowSoftInputMode adjustPan mode is enabled.

Current Behavior

  1. The keyboard height includes the navigation bar height, which makes it kind of useless (its non-consistent and requires manually calculating navigation bar height to make it meaningful) and is a breaking change since it didn't before.
  2. There is no callback occuring on older versions of android with windowSoftInputMode adjustPan set.

Expected Behavior

  1. Keyboard height should only include the height inserted into the webview.
  2. Keyboard callbacks should occur always when windowSoftInputMode adjustPan is set.

Code Reproduction

Other Technical Details

Additional Context

See PR that broke functionality: https://github.com/ionic-team/capacitor-plugins/pull/1980

chriswep commented 2 months ago

those are basically two different issues that were introduced by the same refactor (basically a rewrite) of the plugin.

i already created a issue including reproduction repo for "adjustPan on older Androids" here: https://github.com/ionic-team/capacitor-plugins/issues/2158

The thing about the navigation bar is that it depends on wether you run your app in immersive mode or not. If yes, the webview also covers the navbar space. The plugin should detect that and add the navbar height correspondingly.

xanather commented 2 months ago

My bad @chriswep GitHub issue search sucks. I started digging into this issue hours ago which that would've popped up.

Technically going solely off just the titles this is a different issue though but related so I'll leave this up.

Ionitron commented 2 months 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 💙

xanather commented 2 months ago

I'm not going to do that as I am short on time. I love the work that the OSS community has put into capacitor but all you need to do is read the merged PR for the complaints. There is enough information across the two issues and PR I linked.

nichovski88 commented 1 month ago

I'm facing the same issue. On 6.0.2, the plugin returns the wrong keyboard. I suppose the navbar is calculated as well.