chore: rename html element for context

This commit is contained in:
Christian Andolf
2025-04-02 13:53:20 +02:00
parent d4f5aea31c
commit 7b66533dba

View File

@@ -34,14 +34,14 @@ export default function GuestsRoomsPickerForm() {
//isOpen is the 'old state', so isOpen === true means "The modal is open and WILL be closed".
async function setOverflowClip(isOpen: boolean) {
const htmlElement = document.body
if (htmlElement) {
const bodyElement = document.body
if (bodyElement) {
if (isOpen) {
htmlElement.style.overflow = "visible"
bodyElement.style.overflow = "visible"
} else {
// !important needed to override 'overflow: hidden' set by react-aria.
// 'overflow: hidden' does not work in combination with other sticky positioned elements, which clip does.
htmlElement.style.overflow = "clip !important"
bodyElement.style.overflow = "clip !important"
}
}
if (!isOpen) {