Fix AutoScroll stopping a viewport short of the end
Deploy with Docker Compose / deploy (push) Successful in 24s

scrollTop saturates at scrollHeight - clientHeight, so scaling pos by the
full scrollHeight meant the drift ran out of travel before pos reached 1.

Co-Authored-By: Claude Code <[email protected]>
This commit is contained in:
2026-09-22 23:14:19 +01:00
co-authored by Claude Code
parent 03e10be2e4
commit a362d12ebc
+4 -1
View File
@@ -36,7 +36,10 @@ let cachedScrollHeight = 0;
function measureScrollHeight() { function measureScrollHeight() {
const el = container.value; const el = container.value;
if (el) cachedScrollHeight = el.scrollHeight; // Scrollable range, not full content height: scrollTop saturates at
// scrollHeight - clientHeight, so using scrollHeight would stop the drift
// one viewport short of the end while pos still climbed to 1.
if (el) cachedScrollHeight = Math.max(0, el.scrollHeight - el.clientHeight);
} }
function stopLoop() { function stopLoop() {