Wait before binding resetHeight

This commit is contained in:
Dustin Brett 2023-12-15 19:05:32 -08:00
parent 4dcbef6c40
commit b43254fe0c

View file

@ -28,16 +28,18 @@ const useHeightOverride = (): number => {
const resetHeight = (): void => setHeight(0);
window.addEventListener(
"resize",
resetHeight,
ONE_TIME_PASSIVE_EVENT
);
window.screen.orientation?.addEventListener(
"change",
resetHeight,
ONE_TIME_PASSIVE_EVENT
);
setTimeout(() => {
window.addEventListener(
"resize",
resetHeight,
ONE_TIME_PASSIVE_EVENT
);
window.screen.orientation?.addEventListener(
"change",
resetHeight,
ONE_TIME_PASSIVE_EVENT
);
}, 500);
}
});
}