fix(android): use interactive-widget=resizes-content for keyboard resize - #2344
Merged
Merged
Conversation
The Android build relied on cordova-plugin-ionic-keyboard (via the resizeOnFullScreen preference) to resize the layout when the software keyboard opens, so fixed-position dialogs (e.g. the login dialog) don't end up hidden behind it. That preference has been set to false since d97f016 (2023, to fix live-mode board resize), which is also the plugin's built-in default, so the workaround has been inert for two years. The plugin is also unmaintained (last publish 2019) and is being removed from the ccboard project (cboard-org/ccboard#83, #68) because of an unrelated iOS layout bug on notched devices. Add interactive-widget=resizes-content to the viewport meta tag instead. Supported by Chrome 108+ (the Android WebView engine), it shrinks the layout viewport when the keyboard appears, which is what MUI v4's Dialog (position: fixed, sized against the layout viewport) needs to stay fully visible above the keyboard - without any native plugin. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WdYCb68usnzVF12qvyB2vP
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds
interactive-widget=resizes-contentto the viewport meta tag so the layout viewport shrinks when the Android soft keyboard opens — fixing dialogs (e.g. login) sitting behind the keyboard, without a native plugin.Why not the existing plugin?
cordova-plugin-ionic-keyboard'sresizeOnFullScreenpreference used to do this, but it's beenfalse(the plugin's own default) since d97f016 in 2023 — a fix for live-mode board resize that silently disabled the keyboard workaround. The plugin is unmaintained (last npm publish 2019) and is being removed fromcboard-org/ccboard(see cboard-org/ccboard#68, #83) because of an unrelated iOS layout bug on notched devices. This PR replaces its one useful Android behavior with a standards-based equivalent (Chrome 108+, i.e. Android WebView).Companion change
cboard-org/ccboard#(plugin removal PR) removes the plugin from the Cordova shell. This PR should be verified on an Android device before that one merges.
🤖 Generated with Claude Code
https://claude.ai/code/session_01WdYCb68usnzVF12qvyB2vP