From 6515cf5d7c62fc1691ef8516d0ec53f1f09b2392 Mon Sep 17 00:00:00 2001 From: Yauheni Pasiukevich Date: Thu, 19 Oct 2023 20:34:54 +0200 Subject: [PATCH] fix safari hidden header --- src/components/withViewportOffsetTop.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/withViewportOffsetTop.tsx b/src/components/withViewportOffsetTop.tsx index f2cec3145ee9..e2e1dc2d3484 100644 --- a/src/components/withViewportOffsetTop.tsx +++ b/src/components/withViewportOffsetTop.tsx @@ -14,7 +14,7 @@ export default function withViewportOffsetTop { const updateDimensions = (event: Event) => { - const targetOffsetTop = (event.target instanceof HTMLElement && event.target.offsetTop) || 0; + const targetOffsetTop = (event.target instanceof VisualViewport && event.target.offsetTop) || 0; setViewportOffsetTop(targetOffsetTop); };