Skip to content

Commit

Permalink
Merge pull request #207 from akshansh-modi/fix/scroll-detection-fallback
Browse files Browse the repository at this point in the history
Use scrollY with pageYOffset fallback
  • Loading branch information
iArchitSharma committed Jul 8, 2024
2 parents 4b5c603 + 1a876b6 commit 8c97ef1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion site/src/components/Navigation/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ function Navigation({ theme, toggleTheme, showSignUpButton }) {
}
useEffect(() => {
window.addEventListener("scroll", () =>
window.pageYOffset > 50 ? setScroll(true) : setScroll(false)
setScroll((window.scrollY || window.pageYOffset) > 50)
);
}, []);

Expand Down

0 comments on commit 8c97ef1

Please sign in to comment.