diff --git a/packages/web/src/javascripts/App.tsx b/packages/web/src/javascripts/App.tsx index 85fba3420..512686c96 100644 --- a/packages/web/src/javascripts/App.tsx +++ b/packages/web/src/javascripts/App.tsx @@ -47,12 +47,12 @@ let initialCorrectViewportHeight: number | null = null export const setViewportHeightWithFallback = (isOrientationChange = false) => { const newValue = visualViewport && visualViewport.height > 0 ? visualViewport.height : window.innerHeight - if (!newValue) { - document.documentElement.style.setProperty('--viewport-height', '100vh') + if (initialCorrectViewportHeight && newValue < initialCorrectViewportHeight && !isOrientationChange) { return } - if (initialCorrectViewportHeight && newValue < initialCorrectViewportHeight && !isOrientationChange) { + if (!newValue) { + document.documentElement.style.setProperty('--viewport-height', '100vh') return }