streamflow/frontend/public/viewport-fix.js

9 lines
281 B
JavaScript
Raw Permalink Normal View History

// Fix for mobile viewport height with address bar
function setVh() {
const vh = window.innerHeight * 0.01;
document.documentElement.style.setProperty('--vh', `${vh}px`);
}
setVh();
window.addEventListener('resize', setVh);
window.addEventListener('orientationchange', setVh);