prevent scroll on menu toggle

This commit is contained in:
sefaria
2026-06-29 23:01:41 +02:00
parent cb1c21a305
commit 792e08ad03
+2 -2
View File
@@ -16,7 +16,7 @@
if (menuToggleLabel) menuToggleLabel.textContent = 'Close';
mobileMenu.setAttribute('aria-hidden', 'false');
siteContent.setAttribute('inert', '');
menuToggle.focus();
menuToggle.focus({ preventScroll: true });
}
function closeMenu() {
@@ -27,7 +27,7 @@
if (menuToggleLabel) menuToggleLabel.textContent = 'Menu';
mobileMenu.setAttribute('aria-hidden', 'true');
siteContent.removeAttribute('inert');
menuToggle.focus();
menuToggle.focus({ preventScroll: true });
window.setTimeout(() => {
if (!body.classList.contains('menu-open')) {