1313 }"
1414 aria-label =" Sidebar"
1515 >
16- <div class =" h-full px-3 pb-4 bg-lightSidebar dark:bg-darkSidebar border-r border-lightSidebarBorder dark:border-darkSidebarBorder" :class =" {'sidebar-scroll':!isSidebarIconOnly || (isSidebarIconOnly && isSidebarHovering)}" >
16+ <div class =" h-full px-3 pb-20 md:pb- 4 bg-lightSidebar dark:bg-darkSidebar border-r border-lightSidebarBorder dark:border-darkSidebarBorder" :class =" {'sidebar-scroll':!isSidebarIconOnly || (isSidebarIconOnly && isSidebarHovering)}" >
1717 <div class =" af-logo-title-wrapper flex relative transition-all duration-300 ease-in-out h-8 items-center" :class =" {'my-4 ': isSidebarIconOnly && !isSidebarHovering, 'm-4': !isSidebarIconOnly || (isSidebarIconOnly && isSidebarHovering)}" >
1818 <img :src =" loadFile(coreStore.config?.brandLogo || '@/assets/logo.svg')" :alt =" `${ coreStore.config?.brandName } Logo`" class =" af-logo h-8 me-3" :class =" { 'hidden': !(coreStore.config?.showBrandLogoInSidebar !== false && (!iconOnlySidebarEnabled || !isSidebarIconOnly || (isSidebarIconOnly && isSidebarHovering))) }" />
1919 <img :src =" loadFile(coreStore.config?.iconOnlySidebar?.logo || '')" :alt =" `${ coreStore.config?.brandName } Logo`" class =" af-sidebar-icon-only-logo h-8 me-3" :class =" { 'hidden': !(coreStore.config?.showBrandLogoInSidebar !== false && coreStore.config?.iconOnlySidebar?.logo && iconOnlySidebarEnabled && isSidebarIconOnly && !isSidebarHovering) }" />
@@ -430,6 +430,11 @@ onMounted(() => {
430430
431431onUnmounted (() => {
432432 smQuery .removeEventListener (' change' , handleBreakpointChange );
433+ if (isMobile .value && props .sideBarOpen ) {
434+ document .body .style .overflow = ' ' ;
435+ document .body .style .position = ' ' ;
436+ document .body .style .width = ' ' ;
437+ }
433438})
434439
435440watch (() => props .forceIconOnly , (force ) => {
@@ -445,4 +450,21 @@ watch(() => props.forceIconOnly, (force) => {
445450 isSidebarIconOnly .value = false ;
446451 }
447452}, { immediate: true })
453+
454+ watch (() => props .sideBarOpen , (isOpen ) => {
455+ if (isMobile .value ) {
456+ if (isOpen ) {
457+ // Lock body scroll
458+ document .body .style .overflow = ' hidden' ;
459+ document .body .style .position = ' fixed' ;
460+ document .body .style .width = ' 100%' ;
461+ } else {
462+ // Unlock body scroll
463+ document .body .style .overflow = ' ' ;
464+ document .body .style .position = ' ' ;
465+ document .body .style .width = ' ' ;
466+ }
467+ }
468+ }, { immediate: true })
469+
448470 </script >
0 commit comments