Skip to content

fix(SystemBars): avoid extra IME padding on API <= 34 in insets passthrough#8528

Open
MedOussemaNjimi wants to merge 1 commit into
ionic-team:mainfrom
MedOussemaNjimi:fix/systembars-ime-padding-api34
Open

fix(SystemBars): avoid extra IME padding on API <= 34 in insets passthrough#8528
MedOussemaNjimi wants to merge 1 commit into
ionic-team:mainfrom
MedOussemaNjimi:fix/systembars-ime-padding-api34

Conversation

@MedOussemaNjimi

@MedOussemaNjimi MedOussemaNjimi commented Jul 12, 2026

Copy link
Copy Markdown

Fixes #8525

What

Gates the IME padding in the insets passthrough branch of SystemBars (WebView >= 140 + viewport-fit=cover) behind Build.VERSION.SDK_INT >= VANILLA_ICE_CREAM, the same gate that #8439 added to the non-passthrough branch.

Why

Since 8.3.0 (#8384), when an input is focused on Android 10, a gray area the height of the keyboard appears above the keyboard — reproducible with a fresh npm init @capacitor/app@latest app (whose template uses viewport-fit=cover, so the passthrough branch is taken on devices with WebView >= 140).

On API <= 34 Capacitor does not run edge-to-edge, so the system already resizes the window when the IME is shown. On API 29 the compat WindowInsetsCompat.Type.ime() insets are still reported as the keyboard height after that resize, so v.setPadding(0, 0, 0, imeInsets.bottom) compensated for the keyboard a second time, producing the extra gray space. (On API 30–34 the dispatched IME insets are already consumed after the resize, which is why those versions were unaffected.)

#8439 fixed the exact same double-compensation in the non-passthrough branch; the passthrough branch added later in #8424 reintroduced it without the SDK gate. This PR applies the same gate there.

On API 35+ (enforced edge-to-edge) the behavior is unchanged.

Testing

  • ./gradlew compileReleaseJavaWithJavac -b capacitor/build.gradle passes.
  • Repro per the issue: npm init @capacitor/app@latest, add an input field, run on Android 10 — the gray space above the keyboard no longer appears, while API 35+ keyboard handling is untouched.

…hrough

On API <= 34 the window is not edge-to-edge, so the system already
resizes the window when the keyboard is shown. Adding imeInsets.bottom
as view padding in the insets passthrough branch doubled the space,
leaving a gray area the height of the keyboard above it (seen on
Android 10, where the compat IME insets are non-zero after the window
resize).

This applies the same SDK gate that ionic-team#8439 added to the non-passthrough
branch.

Fixes ionic-team#8525
@MedOussemaNjimi MedOussemaNjimi force-pushed the fix/systembars-ime-padding-api34 branch from bb8c346 to b5069f6 Compare July 12, 2026 17:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Capacitor v8.3.0 extra gray space when keyboard is visible

2 participants