I didn't see a ticket for this yet, apologies if I missed it.
When I call document.viewport.getHeight() in iPhone and the address bar is scrolled up to where it's hidden from the user, I get the wrong height. I get the height as if the address bar were still fully visible. Since the address bar is (currently) 60 pixels tall in iPhone Safari, the value is too small by 60.
For now I have:
function getViewportHeight() {
var vph = document.viewport.getHeight();
return (window.innerHeight - 60 == vph ? window.innerHeight : vph);
}
This is awfully fragile but I'm at a loss for a better way.
previous lighthouse ticket #1250 by Nick Wing
I didn't see a ticket for this yet, apologies if I missed it.
When I call document.viewport.getHeight() in iPhone and the address bar is scrolled up to where it's hidden from the user, I get the wrong height. I get the height as if the address bar were still fully visible. Since the address bar is (currently) 60 pixels tall in iPhone Safari, the value is too small by 60.
For now I have:
This is awfully fragile but I'm at a loss for a better way.