feat(keyboard): keyboardWillShow / keyboardWillHide give no way to match the OS keyboard animation (duration, curve)
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 52/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- java, javascript, swift
- Ambito
- mobile-dev
Direzione di ricerca
Start with the native callbacks in android/src/main/java/.../Keyboard.java and ios/Plugin/Keyboard.m, then trace KeyboardInfo in definitions.d.ts. Reproduce with a keyboard-pinned element on Android and iOS to confirm the native animation is currently lost. Done means both keyboardWillShow and keyboardWillHide expose the platform-reported duration and curve through the plugin API on both platforms.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Plugin
Keyboard
Current Behavior
keyboardWillShow carries only keyboardHeight (definitions.d.ts L60–66, KeyboardInfo), and keyboardWillHide carries nothing (Keyboard.m L219 notifyListeners:@"keyboardWillHide" data:nil). The OS animation that moves the keyboard is not reported, although the plugin has it in hand on both platforms:
- Android — the
WindowInsetsAnimationCompat.CallbackinKeyboard.java(L76–121) receives the IME animation inonStart(animation, bounds);animation.getDurationMillis()andanimation.getInterpolator()are available there, but only the height is forwarded (onKeyboardEvent(EVENT_KB_WILL_SHOW, Math.round(imeHeight / density)), L104). The duration and the interpolator vary by OEM and IME — we measured 285 ms with a non-linear interpolator on Samsung One UI against a different curve on the AOSP keyboard — so no constant on the web side can match them. - iOS —
Keyboard.mL257 readsUIKeyboardAnimationDurationUserInfoKeyfor its own webview resize (+0.2), andUIKeyboardAnimationCurveUserInfoKeyis in the sameuserInfo; neither reaches JS.
The effect: anything the web layer pins to the keyboard — a chat composer, a toolbar, a bottom sheet — has to animate with a guessed duration and easing, and visibly lags or overshoots the keyboard as it opens and closes. On Android the mismatch changes from device to device. This is the same gap ionic-team/capacitor#2304 described in 2020 (closed as "tracked for reactions" and later locked); the inset-animation API on Android did not exist then and does now.
Expected Behavior
The keyboardWillShow / keyboardWillHide events give the web layer enough about the OS animation (its duration and its curve, as the platform reports them) to move a pinned element in step with the keyboard, instead of guessing.
Platform(s)
- Android
- iOS
Steps to Reproduce
- Pin an element to the keyboard: on
keyboardWillShowset itsbottomtokeyboardHeightwith a CSS transition, onkeyboardWillHideset it back to 0. - Open and close the keyboard on a Samsung device and on a Pixel.
- With any fixed transition duration/easing, the element either trails behind the keyboard or arrives before it, and the gap differs between the two devices, because the plugin reports only the final height.
Additional Context
@capacitor/keyboard 8.0.6, Capacitor 8.
- 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 66/100
ionic-team/capacitor-plugins#2615 ·
-
triage
Difficoltà 3/5 1-2 giorni Idoneità per principianti 58/100
ionic-team/capacitor-plugins#2614 ·
-
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
-
status: waiting-for-triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 79/100
spring-projects/spring-ai#7206 ·
I maintainer di solito rispondono entro 2 giorni
-
bug ci sev-6
Difficoltà 2/5 1-3 ore Idoneità per principianti 73/100
-
area/cli
Difficoltà 2/5 Mezza giornata Idoneità per principianti 78/100
quarkusio/quarkus#57623 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
jhipster/prettier-java#1113 ·
I maintainer di solito rispondono entro 2 giorni
-
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