more
This commit is contained in:
@@ -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>
|
||||
);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user