Skip to content

fix(android): avoid resizing WebView for keyboard insets#156

Open
buseduran wants to merge 1 commit into
NativePHP:mainfrom
buseduran:android-keyboard-ime-inset
Open

fix(android): avoid resizing WebView for keyboard insets#156
buseduran wants to merge 1 commit into
NativePHP:mainfrom
buseduran:android-keyboard-ime-inset

Conversation

@buseduran

@buseduran buseduran commented Jun 6, 2026

Copy link
Copy Markdown
Contributor

This PR fixes a keyboard animation glitch on Android by avoiding IME inset padding on the WebView container.

Previously, applying WindowInsets.ime padding to the AndroidView resized the WebView while the keyboard animated in. That forced web layouts using viewport units or fixed positioning to reflow during the animation, causing visible jumps.

The activity still uses adjustResize; this only removes the extra Compose IME padding from the WebView container. The WebView continues to respect the Scaffold top/bottom padding, while Chromium handles the visual viewport and focused-field scrolling during keyboard input.

Changes

  • Keep the WebView full-size while still respecting top and bottom navigation padding
  • Let Chromium adjust the visual viewport and scroll the focused field into view
  • Document why IME padding is intentionally not applied to the WebView container

Validation

  • Verified on Android emulator that focusing an input opens the keyboard without the previous WebView jump

@buseduran buseduran force-pushed the android-keyboard-ime-inset branch from e259d3f to 2fcdcbb Compare June 6, 2026 23:16
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.

1 participant