Skip to content

Commit

Permalink
Fixed the popup position for when there is no promo (#3439)
Browse files Browse the repository at this point in the history
add a condition for when the nav promo offset is subtracted from the top of the popup
  • Loading branch information
sharmrj authored and bandana147 committed Jan 14, 2025
1 parent c75a8c2 commit fa83d8e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion libs/blocks/global-navigation/global-navigation.js
Original file line number Diff line number Diff line change
Expand Up @@ -1175,7 +1175,10 @@ class Gnav {
// at this point by calling disableMobileScroll
if (popup && this.isLocalNav()) {
const y = window.scrollY;
popup.style = `top: calc(${y || 0}px - var(--feds-height-nav) - var(--global-height-navPromo)`;
const offset = this.block.classList.contains('has-promo')
? 'var(--feds-height-nav) - var(--global-height-navPromo)'
: 'var(--feds-height-nav)';
popup.style = `top: calc(${y || 0}px - ${offset}`;
}
makeTabActive(popup);
} else if (isDesktop.matches && this.newMobileNav && isSectionMenu) {
Expand Down

0 comments on commit fa83d8e

Please sign in to comment.