diff --git a/src/components/common/ScrollToTop.jsx b/src/components/common/ScrollToTop.jsx index 781be1b..3c9b2f9 100644 --- a/src/components/common/ScrollToTop.jsx +++ b/src/components/common/ScrollToTop.jsx @@ -3,8 +3,12 @@ import { useLocation } from "react-router-dom"; const ScrollToTop = () => { const { pathname } = useLocation(); - useEffect(() => { + const rootContainer = document.querySelector(".root-layout-container"); + if (rootContainer) { + rootContainer.scrollTo(0, 0); + } + window.scrollTo(0, 0); }, [pathname]);