diff --git a/src/utils/hooks/useViewportHeightLock.ts b/src/utils/hooks/useViewportHeightLock.ts index 0bb8ebf..4e3c482 100644 --- a/src/utils/hooks/useViewportHeightLock.ts +++ b/src/utils/hooks/useViewportHeightLock.ts @@ -4,13 +4,16 @@ function useViewportHeightLock() { useLayoutEffect(() => { const root = document.documentElement; const body = document.body; + const prevBodyOverflow = body.style.overflow; const prevBodyHeight = body.style.height; const prevRootHeight = root.style.height; + body.style.overflow = 'hidden'; body.style.height = 'var(--viewport-height)'; root.style.height = 'var(--viewport-height)'; return () => { + body.style.overflow = prevBodyOverflow; body.style.height = prevBodyHeight; root.style.height = prevRootHeight; };