Skip to content

Commit

Permalink
Merge pull request #93 from GountzJs/fix/modify-scroll-navbar-burger
Browse files Browse the repository at this point in the history
fix(components): 🐛 remove scroll when navbar burger active
  • Loading branch information
odracirdev authored Jun 2, 2024
2 parents 3e85807 + 30ad0b6 commit 9ec6a12
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/components/Navbar.astro
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}
Expand Down

0 comments on commit 9ec6a12

Please sign in to comment.