fix(android): account for chrome 108 resize #26244
Merged
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.
Pull request checklist
Please check if your PR fulfills the following requirements:
ionic-docs
repo, in a separate PR. See the contributing guide for details.npm run build
) was run locally and any changes were pushednpm run lint
) has passed locally and any fixes were made for failuresPull request type
Please check the type of change your PR introduces:
What is the current behavior?
Chrome 108 introduces a change to how the Layout Viewport is resized when the on-screen keyboard (OSK) is displayed. In short, the Layout Viewport no longer resizes aligning Android Chrome's behavior with iOS Safari's behavior. As a result, scroll assist is needed for Android devices only when running in a mobile web browser. There are no changes to Android webviews. Full details on the change can be found here: https://developer.chrome.com/blog/viewport-resize-behavior/
What is the new behavior?
Note: It is not currently possible to read the browser's resize behavior. There are some workarounds we can implement such as checking to see that the layout viewport does not change when the keyboard is open, but they are somewhat complex to implement in Ionic. I created video comparisons with Chrome 108 and pre-Chrome 108 behaviors.
Chrome 107
main
chrome107-no-sa.mp4
chrome107-sa.mp4
Chrome 108 Beta
main
chrome108-no-sa.mp4
chrome108-sa.mp4
One unfortunate downside is that apps running in mobile Chrome may encounter #18532. (As noted before, this has no impact on Android webview apps i.e. Capacitor/Cordova). However, this bug in fixed in Ionic 7. If this issue is a blocker for developers before Ionic 7 is released, they can also opt Chrome into using the legacy resize behavior until Ionic 7 by adding
interactive-widget=overlays-content
to theirviewport
meta tag.Full Example:
Does this introduce a breaking change?
Other information