Skip to content

Commit

Permalink
Popup position fix for iPhone (#3440)
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

* fixed popup height for iphone

* moved the popup 1px up
  • Loading branch information
sharmrj authored and bandana147 committed Jan 9, 2025
1 parent 2faadab commit 68460c1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion libs/blocks/global-navigation/global-navigation.js
Original file line number Diff line number Diff line change
Expand Up @@ -1175,10 +1175,11 @@ class Gnav {
// at this point by calling disableMobileScroll
if (popup && this.isLocalNav()) {
const y = window.scrollY;
const iOSy = Math.abs(parseInt(document.body.style.top, 10));
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}`;
popup.style = `top: calc(${iOSy || y || 0}px - ${offset} - 1px`;
}
makeTabActive(popup);
} else if (isDesktop.matches && this.newMobileNav && isSectionMenu) {
Expand Down

0 comments on commit 68460c1

Please sign in to comment.