Skip to content

Commit

Permalink
Use scrollY with pageYOffset fallback
Browse files Browse the repository at this point in the history
Signed-off-by: Akshansh <[email protected]>
  • Loading branch information
akshansh-modi committed Jul 6, 2024
1 parent 4b5c603 commit 1a876b6
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 1a876b6

Please sign in to comment.