-
-
Notifications
You must be signed in to change notification settings - Fork 570
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Google Chrome 108 broke the library on mobile #859
Comments
It seems that the problem is with Android <=8, I was able to reproduce it on BrowserStack (with Pixel 2). For new Android you can use: body {
height: 100dvh;
} to set a dynamic viewport. On Android <=8 it doesn't work, but I've found a hack: window.addEventListener('resize', () => {
const { height } = window.visualViewport;
document.documentElement.style.setProperty('--terminal-force-height', height);
}); and in CSS you can use: body {
height: calc(var(--terminal-force-height, 100dvh) * 1px);
} The issue was reported to Google Chrome #1413453 |
The dynamic-viewport workaround is not propertly working on Android 13 (neither with Firefox nor with Chromium-based browsers), simply because the I've tried to come up with something that preserves the hack, while taking into account the scale problem. |
@cowuake I actually never use Zoom on mobile, that's why I didn't even try to fix this. I would only change: var scale = window.visualViewport.scale;
var height = Math.round(window.visualViewport.height * scale); You can create PR to the devel branch and I will check on BrowserStack how it works on iOS. |
Issue summary
Google Chrome in version 108 changed the way height: 100% works on body and HTML tags. And now the library is broken. The fix works on BrowserStack but not on my real phone
Steps to reproduce
Browser and OS
Android, Google Chrome >=108
Additional notes
Here is a demo with an attempted fix that doesn't work:
https://codepen.io/jcubic/pen/LYBaQOJ?editors=0100
The text was updated successfully, but these errors were encountered: