fix(mobile-menu): make menu scrollable when content overflows
After adding the products dropdown (7 categories + 27 subcategory links), the mobile menu was taller than typical phone screens (~640px on iPhone SE). Without overflow handling, users on short screens could not reach the bottom items (ผลงาน, ติดต่อเรา). Added to mobile menu container: - max-h-[calc(100vh-4rem)]: cap height at viewport minus header - overflow-y-auto: enable internal scrollbar when content overflows - overscroll-contain: prevent scroll chain to background page (iOS Safari specific) Menu is now fully scrollable within its own container — page content underneath stays still while user scrolls through menu items.
This commit is contained in:
@@ -418,7 +418,7 @@ const productLinks = [
|
||||
</nav>
|
||||
|
||||
<!-- Mobile Menu -->
|
||||
<div id="mobile-menu" class="lg:hidden hidden bg-white border-t border-neutral-100">
|
||||
<div id="mobile-menu" class="lg:hidden hidden bg-white border-t border-neutral-100 max-h-[calc(100vh-4rem)] overflow-y-auto overscroll-contain">
|
||||
<div class="px-4 py-6 space-y-4">
|
||||
<a href="/" class="block text-neutral-600 hover:text-primary-600 font-medium py-2">หน้าแรก</a>
|
||||
<a href="/about-us" class="block text-neutral-600 hover:text-primary-600 font-medium py-2">เกี่ยวกับเรา</a>
|
||||
|
||||
Reference in New Issue
Block a user