Update Layout.tsx

This commit is contained in:
Egor
2026-01-16 05:43:34 +03:00
committed by GitHub
parent 2edbf398e3
commit b82db24400

View File

@@ -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 = ''