Skip to content

Commit

Permalink
guarded agains disable mobile scroll being called twice
Browse files Browse the repository at this point in the history
  • Loading branch information
sharmrj committed Jan 13, 2025
1 parent b60917e commit d7a0ad1
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions libs/blocks/global-navigation/utilities/utilities.js
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,8 @@ export function closeAllDropdowns({ type } = {}) {

export const disableMobileScroll = () => {
if (!PERSONALIZATION_TAGS.safari()) return;
if (document.body.classList.contains('disable-ios-scroll')) return;
if (document.body.style.top) return;
document.body.style.top = `-${window.scrollY}px`;
document.body.classList.add('disable-ios-scroll');

Check warning on line 321 in libs/blocks/global-navigation/utilities/utilities.js

View check run for this annotation

Codecov / codecov/patch

libs/blocks/global-navigation/utilities/utilities.js#L318-L321

Added lines #L318 - L321 were not covered by tests
};
Expand Down

0 comments on commit d7a0ad1

Please sign in to comment.