1
0
mirror of https://github.com/amir20/dozzle.git synced 2025-12-21 21:33:18 +01:00

fix: fixes negative scrollvalues

This commit is contained in:
Amir Raminfar
2023-08-18 12:54:45 -07:00
parent 54610b0f5a
commit a150b44bec

View File

@@ -48,7 +48,7 @@ watchPostEffect(() => {
scrollElement.value === document
? (scrollElement.value as Document).documentElement
: (scrollElement.value as HTMLElement);
scrollProgress.value = Math.min(scrollY.value / (parent.scrollHeight - parent.clientHeight), 1);
scrollProgress.value = Math.max(0, Math.min(1, scrollY.value / (parent.scrollHeight - parent.clientHeight)));
if (autoHide) {
show.value = true;
}