From 1a876b621642d745218c38ee0efdd26866837a82 Mon Sep 17 00:00:00 2001 From: Akshansh Date: Sat, 6 Jul 2024 15:09:58 +0530 Subject: [PATCH] Use scrollY with pageYOffset fallback Signed-off-by: Akshansh --- site/src/components/Navigation/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/site/src/components/Navigation/index.js b/site/src/components/Navigation/index.js index 5af8e4e..8a18d9b 100644 --- a/site/src/components/Navigation/index.js +++ b/site/src/components/Navigation/index.js @@ -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) ); }, []);