From 72609459c6971b18ea1818ec0afab719a39d821e Mon Sep 17 00:00:00 2001 From: Dustin Brett Date: Thu, 6 Apr 2023 21:30:22 -0700 Subject: [PATCH] Use window.innerHeight instead --- hooks/useHeightOverride.tsx | 4 ++-- pages/_document.tsx | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/hooks/useHeightOverride.tsx b/hooks/useHeightOverride.tsx index 63b41a2b..0b5c604a 100644 --- a/hooks/useHeightOverride.tsx +++ b/hooks/useHeightOverride.tsx @@ -15,8 +15,8 @@ const useHeightOverride = (): number => { typeof window !== "undefined" && typeof window.initialHeight === "number" && window.initialHeight > 0 && - window.initialHeight !== document.documentElement.clientHeight && - document.documentElement.clientHeight > window.screen.height && + window.initialHeight !== window.innerHeight && + window.innerHeight > window.screen.height && /android|iphone/i.test(navigator.userAgent) ) { setHeight(window.initialHeight); diff --git a/pages/_document.tsx b/pages/_document.tsx index 2d35090c..e3268c4c 100644 --- a/pages/_document.tsx +++ b/pages/_document.tsx @@ -40,7 +40,7 @@ class Document extends NextDocument {