From 84b04f9d324cb2aa31c57cb4a3a6547e09af7688 Mon Sep 17 00:00:00 2001 From: Raghav Sharma Date: Tue, 7 Jan 2025 08:57:21 +0530 Subject: [PATCH] gave ios-disable-scroll the correct behavior for non localnavs as well --- libs/blocks/global-navigation/global-navigation.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/libs/blocks/global-navigation/global-navigation.js b/libs/blocks/global-navigation/global-navigation.js index fb62a23e7a..6063ced23b 100644 --- a/libs/blocks/global-navigation/global-navigation.js +++ b/libs/blocks/global-navigation/global-navigation.js @@ -784,6 +784,8 @@ class Gnav { const section = sections[0]; queueMicrotask(() => section.click()); } + } else if (isExpanded && this.newMobileNav) { + enableMobileScroll(); } toggle?.setAttribute('aria-expanded', !isExpanded); document.body.classList.toggle('disable-scroll', !isExpanded); @@ -1128,10 +1130,12 @@ class Gnav { dropdownTrigger.addEventListener('click', (e) => { if (!isDesktop.matches && this.newMobileNav && isSectionMenu) { const popup = dropdownTrigger.nextElementSibling; - const y = Math.abs(parseInt(document.body.style.top, 10)); // document.body.style.top should always be set // at this point by calling disableMobileScroll - if (popup) popup.style.top = `calc(${y || 0}px - var(--feds-height-nav) - 1px)`; + if (popup && this.isLocalNav()) { + const y = Math.abs(parseInt(document.body.style.top, 10)); + popup.style.top = `calc(${y || 0}px - var(--feds-height-nav) - 1px)`; + } makeTabActive(popup); } else if (isDesktop.matches && this.newMobileNav && isSectionMenu) { const popup = dropdownTrigger.nextElementSibling;