Skip to content

fix(android): restore content height when keyboard hides via insets l…#57

Open
TheCorbin wants to merge 1 commit intoionic-team:mainfrom
TheCorbin:fix/ghost-keyboard-resize-on-hide
Open

fix(android): restore content height when keyboard hides via insets l…#57
TheCorbin wants to merge 1 commit intoionic-team:mainfrom
TheCorbin:fix/ghost-keyboard-resize-on-hide

Conversation

@TheCorbin
Copy link
Copy Markdown

@TheCorbin TheCorbin commented Mar 17, 2026

The onApplyWindowInsetsListener only called possiblyResizeChildOfContent when the keyboard was showing, but never restored the content height when the keyboard was dismissed. This caused a ghost keyboard bug where returning to the app after using the keyboard in the notification pane left a black space where the keyboard was, because the content view height remained shrunk.

The fix passes the current keyboard visibility state to possiblyResizeChildOfContent so it resets the height to MATCH_PARENT when the keyboard is no longer visible. This handles cases where the keyboard is dismissed without a WindowInsetsAnimation (e.g. switching back to the app from the notification shade).

Description

Change Type

  • Fix
  • Feature
  • Refactor
  • Breaking Change
  • Documentation

Rationale / Problems Fixed

Tests or Reproductions

Screenshots / Media

Platforms Affected

  • Android
  • iOS
  • Web

Notes / Comments

…istener

The onApplyWindowInsetsListener only called possiblyResizeChildOfContent
when the keyboard was showing, but never restored the content height when
the keyboard was dismissed. This caused a ghost keyboard bug where
returning to the app after using the keyboard in the notification pane
left a black space where the keyboard was, because the content view
height remained shrunk.

The fix passes the current keyboard visibility state to
possiblyResizeChildOfContent so it resets the height to MATCH_PARENT
when the keyboard is no longer visible. This handles cases where the
keyboard is dismissed without a WindowInsetsAnimation (e.g. switching
back to the app from the notification shade).
@tafelnl
Copy link
Copy Markdown

tafelnl commented Mar 18, 2026

It would be even better to get rid of this code within this plugin altogether. I proposed this some time ago here. It's a bit unexpected to have this behavior still in place here, when it can easily be integrated in the core. Having this logic in two different places will lead to unexpected behavior such as this bug sooner or later

@tafelnl
Copy link
Copy Markdown

tafelnl commented Mar 18, 2026

For reference: duplicate of #53

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.

2 participants