Use content height

This commit is contained in:
Nicolas Mowen 2024-10-02 08:11:39 -06:00
parent 38665eb5f8
commit ecc649e23b
2 changed files with 16 additions and 4 deletions

View File

@ -634,10 +634,16 @@ function DetectionReview({
} }
break; break;
case "PageDown": case "PageDown":
contentRef.current?.scrollBy({ top: 600, behavior: "smooth" }); contentRef.current?.scrollBy({
top: contentRef.current.clientHeight / 2,
behavior: "smooth",
});
break; break;
case "PageUp": case "PageUp":
contentRef.current?.scrollBy({ top: -600, behavior: "smooth" }); contentRef.current?.scrollBy({
top: -contentRef.current.clientHeight / 2,
behavior: "smooth",
});
break; break;
} }
}); });

View File

@ -241,10 +241,16 @@ export default function SearchView({
}); });
break; break;
case "PageDown": case "PageDown":
contentRef.current?.scrollBy({ top: 600, behavior: "smooth" }); contentRef.current?.scrollBy({
top: contentRef.current.clientHeight / 2,
behavior: "smooth",
});
break; break;
case "PageUp": case "PageUp":
contentRef.current?.scrollBy({ top: -600, behavior: "smooth" }); contentRef.current?.scrollBy({
top: -contentRef.current.clientHeight / 2,
behavior: "smooth",
});
break; break;
} }
}, },