Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

feat(keyboard): keyboardWillShow / keyboardWillHide give no way to match the OS keyboard animation (duration, curve)

Aperta
#2,613 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

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

platform: android platform: ios
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.Callback in Keyboard.java (L76–121) receives the IME animation in onStart(animation, bounds); animation.getDurationMillis() and animation.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.m L257 reads UIKeyboardAnimationDurationUserInfoKey for its own webview resize (+0.2), and UIKeyboardAnimationCurveUserInfoKey is in the same userInfo; 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
  1. Pin an element to the keyboard: on keyboardWillShow set its bottom to keyboardHeight with a CSS transition, on keyboardWillHide set it back to 0.
  2. Open and close the keyboard on a Samsung device and on a Pixel.
  3. 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

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di ionic-team/capacitor-plugins

Tutte le issue di ionic-team/capacitor-plugins

Issue simili

Altre issue su Java

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.