From 2db22f995543d41bcb9f49d876fa3412751226e3 Mon Sep 17 00:00:00 2001 From: ajdj100 Date: Sun, 22 Mar 2026 13:15:53 -0400 Subject: [PATCH] Fixed a bunch of issues with the navbar for different devices --- ui/src/components/Navigation/Navbar.vue | 49 ++++++++++++++++++++++--- 1 file changed, 44 insertions(+), 5 deletions(-) diff --git a/ui/src/components/Navigation/Navbar.vue b/ui/src/components/Navigation/Navbar.vue index 099e634..e495daa 100644 --- a/ui/src/components/Navigation/Navbar.vue +++ b/ui/src/components/Navigation/Navbar.vue @@ -22,7 +22,7 @@ import DropdownMenuGroup from '../ui/dropdown-menu/DropdownMenuGroup.vue'; import DropdownMenuSeparator from '../ui/dropdown-menu/DropdownMenuSeparator.vue'; import { MemberState } from '@shared/types/member'; - import { computed, nextTick, ref } from 'vue'; + import { computed, onBeforeUnmount, ref, watch } from 'vue'; const userStore = useUserStore(); const auth = useAuth(); @@ -175,6 +175,35 @@ closeMobileMenu(); router.push(to); } + + function lockDocumentScroll() { + document.documentElement.style.overflow = 'hidden'; + document.documentElement.style.overscrollBehavior = 'none'; + document.body.style.overflow = 'hidden'; + document.body.style.overscrollBehavior = 'none'; + document.body.style.touchAction = 'none'; + } + + function unlockDocumentScroll() { + document.documentElement.style.overflow = ''; + document.documentElement.style.overscrollBehavior = ''; + document.body.style.overflow = ''; + document.body.style.overscrollBehavior = ''; + document.body.style.touchAction = ''; + } + + watch(isMobileMenuOpen, (isOpen) => { + if (isOpen) { + lockDocumentScroll(); + return; + } + + unlockDocumentScroll(); + }); + + onBeforeUnmount(() => { + unlockDocumentScroll(); + });