From 59e5c953462caf0309b0c47b90d5465725dc8e24 Mon Sep 17 00:00:00 2001 From: Stan Wohlwend Date: Sun, 2 Jun 2024 20:51:45 +0200 Subject: [PATCH] Mute MaybeFullPage error --- packages/stack/src/components/maybe-full-page.tsx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packages/stack/src/components/maybe-full-page.tsx b/packages/stack/src/components/maybe-full-page.tsx index 0185a9bc7..d8950ebd1 100644 --- a/packages/stack/src/components/maybe-full-page.tsx +++ b/packages/stack/src/components/maybe-full-page.tsx @@ -15,6 +15,11 @@ export default function MaybeFullPage({ const scriptString = `(([id]) => { const el = document.getElementById(id); + if (!el) { + // this may happen occasionally when the element is removed by React or another library + // just ignore it + return; + } const offset = el.getBoundingClientRect().top + document.documentElement.scrollTop; el.style.minHeight = \`calc(100vh - \${offset}px)\`; })(${JSON.stringify([id])})`;