mirror of
https://github.com/chillpadclub/bedolaga-cabinet.git
synced 2026-07-28 17:43:47 +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(() => {
|
useEffect(() => {
|
||||||
if (mobileMenuOpen) {
|
if (mobileMenuOpen) {
|
||||||
|
// Scroll to top so header is visible
|
||||||
|
window.scrollTo({ top: 0, behavior: 'instant' })
|
||||||
document.body.style.overflow = 'hidden'
|
document.body.style.overflow = 'hidden'
|
||||||
} else {
|
} else {
|
||||||
document.body.style.overflow = ''
|
document.body.style.overflow = ''
|
||||||
|
|||||||
Reference in New Issue
Block a user