From 30ad0b614dc0494f6e0d06b430bc3d64ecbcd539 Mon Sep 17 00:00:00 2001 From: Gountzjs Date: Sun, 2 Jun 2024 17:00:44 -0300 Subject: [PATCH] fix(components): :bug: remove scroll when navbar burger active --- src/components/Navbar.astro | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/components/Navbar.astro b/src/components/Navbar.astro index 2c25e8a..9d01f19 100644 --- a/src/components/Navbar.astro +++ b/src/components/Navbar.astro @@ -292,9 +292,11 @@ const isOpen = navBar.getAttribute(dataStatus) === 'open'; if (isOpen) { + document.querySelector('body').style.removeProperty('overflow-y'); navBar.setAttribute(dataStatus, 'close'); burgerMenu.setAttribute(dataStatus, 'close'); } else { + document.querySelector('body').style.overflowY = 'hidden'; navBar.setAttribute(dataStatus, 'open'); burgerMenu.setAttribute(dataStatus, 'open'); }