bug(ios): Stage Manager reports keyboardHeight 0 for a full keyboard (overlap checked against 20% of the screen)

Aperta
#89 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
56/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
ios, typescript
Ambito
mobile

Direzione di ricerca

The issue identifies Keyboard.m and onKeyboardWillShow, including the overlap calculation and shouldIgnoreResizeForHeight:. Read that path and check how UIKeyboardFrameEndUserInfoKey distinguishes the shortcut bar from a full keyboard. Done when Stage Manager reports the window overlap and resizes for a software keyboard, while the hardware keyboard shortcut bar still reports 0.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Bug Report

Plugin(s): @capacitor/keyboard 8.0.6

Capacitor version: 8

Platform(s): iOS (iPadOS), Stage Manager

Current Behavior

In Stage Manager on iPad, keyboardWillShow / keyboardDidShow report keyboardHeight: 0 for a full software keyboard when the app window only partly overlaps it, and the web view is not resized. Inputs near the bottom of the window end up behind the keyboard, and nothing in the page signals that a keyboard is covering it.

In Keyboard.m, onKeyboardWillShow computes the iPad height as the overlap between the web view and the keyboard (webViewAbsolute vs UIScreen.mainScreen.bounds). It then passes that overlap to shouldIgnoreResizeForHeight:, which treats any height under 20% of the screen height as the hardware-keyboard shortcut bar and reports 0. In a Stage Manager window, a full keyboard's overlap with the window is often under 20% of the screen, so it gets dropped.

Expected Behavior

The overlap is reported (and the web view resized) whenever a real software keyboard covers the window. Only the shortcut bar shown with a hardware keyboard reports 0.

Code Reproduction
  1. Seen on an iPad Pro 11-inch (M4) simulator, iPadOS 18.3. Any app using @capacitor/keyboard with resize native, on an iPad simulator with Stage Manager on, the app in a window whose bottom edge sits a little above the keyboard's top.
  2. Focus an input near the bottom of the window.
  3. keyboardWillShow fires with keyboardHeight: 0, and the input stays covered.
Other Technical Details

A fix could decide "shortcut bar or keyboard" from the keyboard's own frame height (UIKeyboardFrameEndUserInfoKey), which is small for the shortcut bar and large for a software keyboard, instead of from the overlap.

Related: #79 (the late resize with resize: native).

Lingua principale
TypeScript
Stelle
6
Fork
24
Merge medio
2g 4h
PR unite (30g)
6

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-keyboard

Tutte le issue di ionic-team/capacitor-keyboard

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.