Mute MaybeFullPage error

This commit is contained in:
Stan Wohlwend 2024-06-02 20:51:45 +02:00
parent f1906bc2b2
commit 59e5c95346

View File

@ -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])})`;