diff --git a/src/Components/Document/ReqEditPage.js b/src/Components/Document/ReqEditPage.js index 7aa2890..9bf9a97 100644 --- a/src/Components/Document/ReqEditPage.js +++ b/src/Components/Document/ReqEditPage.js @@ -90,9 +90,19 @@ const RequestEditPage = () => { } } + const onScrollClick = () => { + const bottom = window.document.scrollingElement.scrollHeight; + const place = window.scrollY; + if (place > bottom / 2) { + window.scrollTo({ top: 0, behavior: "smooth" }); + } else if (place < bottom / 2) { + window.scrollTo({ top: bottom, behavior: "smooth" }); + } + }; + return (
-
{headerPicker()}
+
{headerPicker(state, fetchedCase, onScrollClick)}
); };