Wait before binding resetHeight
This commit is contained in:
parent
4dcbef6c40
commit
b43254fe0c
1 changed files with 12 additions and 10 deletions
|
@ -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);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue