mirror of
https://github.com/chillpadclub/bedolaga-cabinet.git
synced 2026-07-28 09:33:46 +00:00
Update Layout.tsx
This commit is contained in:
@@ -149,9 +149,11 @@ export default function Layout({ children }: LayoutProps) {
|
||||
}
|
||||
}, [])
|
||||
|
||||
// Lock body scroll when mobile menu is open
|
||||
// Lock body scroll and scroll to top when mobile menu is open
|
||||
useEffect(() => {
|
||||
if (mobileMenuOpen) {
|
||||
// Scroll to top so header is visible
|
||||
window.scrollTo({ top: 0, behavior: 'instant' })
|
||||
document.body.style.overflow = 'hidden'
|
||||
} else {
|
||||
document.body.style.overflow = ''
|
||||
|
||||
Reference in New Issue
Block a user