Skip to content

Commit

Permalink
Set the scroll to the current number on scroll when scroll is disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
sharmrj committed Jan 6, 2025
1 parent b17e60d commit 02df401
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions libs/blocks/global-navigation/global-navigation.js
Original file line number Diff line number Diff line change
Expand Up @@ -408,6 +408,7 @@ class Gnav {
const current = window.scrollY;
const f = (event) => {
event.preventDefault();
window.scroll(0, current);
};
window.addEventListener('scroll', f);
return () => { window.removeEventListener('scroll', f); };
Expand Down

0 comments on commit 02df401

Please sign in to comment.