This commit is contained in:
Kenneth Jannette
2024-03-02 01:20:06 -06:00
parent 94d7bc6c2e
commit 9e2faab87b

View File

@@ -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 (
<div>
<div> {headerPicker()}</div>
<div> {headerPicker(state, fetchedCase, onScrollClick)}</div>
</div>
);
};