diff --git a/web/ASC.Web.Common/src/components/Layout/ScrollToTop.js b/web/ASC.Web.Common/src/components/Layout/ScrollToTop.js index 1c65935613..f52b2c410b 100644 --- a/web/ASC.Web.Common/src/components/Layout/ScrollToTop.js +++ b/web/ASC.Web.Common/src/components/Layout/ScrollToTop.js @@ -5,8 +5,8 @@ export default function ScrollToTop() { const { pathname } = useLocation(); useEffect(() => { - document.getElementById("customScrollBar") && - document.getElementById("customScrollBar").scrollTo(0, 0); + const documentScrollElement = document.getElementById("customScrollBar"); + documentScrollElement && documentScrollElement.scrollTo(0, 0); }, [pathname]); return null;