bug(keyboard): with `resize: none` on API < 35, `keyboardHeight` is the raw IME inset from the window bottom and overstates the part of the WebView the keyboard actually covers by the navigation-bar height
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 66/100
Direzione di ricerca
Start with Keyboard.java at the reported lines 97, 106, 119, and 124, and trace how the IME and navigation bar insets relate to the WebView bounds on API levels below 35. Check the existing keyboard event tests and run the Android plugin tests. Done means keyboardHeight reflects the portion of the WebView covered by the keyboard across API levels, including both will-show and did-show events.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Plugin
Keyboard 8.0.6
Current Behavior
Keyboard.java L97 / L106 (and L119 / L124 for the did-show pair):
int imeHeight = insets.getInsets(WindowInsetsCompat.Type.ime()).bottom;
...
keyboardEventListener.onKeyboardEvent(EVENT_KB_WILL_SHOW, Math.round(imeHeight / density));
ime().bottom is measured from the bottom of the window. On API < 35 (no enforced edge-to-edge) the WebView ends above the navigation bar, so the keyboard covers imeHeight − navigationBarHeight of it, but the plugin reports imeHeight. An app that uses resize: none and moves its own composer by keyboardHeight (the documented way to animate with the keyboard) leaves a gap the size of the navigation bar (≈ 48 dp on a 3-button bar, ≈ 24 dp with gesture navigation) between the composer and the keyboard. On API 35+ the WebView reaches the window bottom and the number is right, so the same app behaves differently per OS version.
Measured on the Android 14 emulator (API 34, Pixel 6 profile, 1080×2400 @ 420 dpi, density 2.625, Gboard, 3-button navigation), windowSoftInputMode="adjustNothing", keyboard open on a field inside the WebView, read from dumpsys window and dumpsys activity top:
| px | dp | |
|---|---|---|
IME inset (type=ime frame=[0,1517][1080,2400], measured from the window bottom) — what L97/L106 report |
883 | 336 |
navigation bar (type=navigationBars frame=[0,2274][1080,2400]) |
126 | 48 |
WebView (CapacitorWebView 0,0-1080,2274, window frame=[0,0][1080,2400]) ends above the bar |
— | — |
| part of the WebView the keyboard actually covers (2274 − 1517) | 757 | 288 |
With @capacitor/keyboard 8.0.6 unmodified, the keyboardWillShow / keyboardDidShow payload on that run was {keyboardHeight: 336}. So keyboardHeight arrives as 336 while the keyboard covers 288 of the WebView's 867 CSS px; a composer moved up by keyboardHeight floats 48 dp above the keyboard. (The same WebView on an API 35 device reaches the window bottom, and 336 would be right there.)
Expected Behavior
keyboardHeight describes how much of the WebView the keyboard covers, the same on every API level.
- Lingua principale
- Java
- Stelle
- 685
- Fork
- 691
- Merge medio
- 16h 33m
- PR unite (30g)
- 1
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di ionic-team/capacitor-plugins
-
triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
ionic-team/capacitor-plugins#2616 ·
-
[@capacitor/app] iOS: 'Expression implicitly coerced from String? to Any' warning in getAppLanguageApertatriage
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
ionic-team/capacitor-plugins#2604 ·
-
triage
Difficoltà 3/5 1-2 giorni Idoneità per principianti 58/100
ionic-team/capacitor-plugins#2614 ·
-
platform: android platform: ios
Difficoltà 4/5 3-5 giorni Idoneità per principianti 52/100
ionic-team/capacitor-plugins#2613 ·
-
bug(browser): Browser.close() on Android re-opens the last URL after a deep link back into the appForse già presa @pramoth l’ha presa 4 giorni fa. Apertaplatform: android platform: ios
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
ionic-team/capacitor-plugins#2610 ·
Tutte le issue di ionic-team/capacitor-plugins
Issue simili
-
bug follow-up lane:backlog
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
Sanne/incus-spawn#1576 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 69/100
checkstyle/checkstyle#22069 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 86/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 67/100
it-at-m/eNoVa-Editor#79 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
I maintainer di solito rispondono entro 1 giorno