From a362d12ebce64c2e72baccc7db28cdeba4f08d51 Mon Sep 17 00:00:00 2001 From: Adam French Date: Tue, 22 Sep 2026 23:14:19 +0100 Subject: [PATCH] Fix AutoScroll stopping a viewport short of the end 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 --- vue/src/components/util/AutoScroll.vue | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/vue/src/components/util/AutoScroll.vue b/vue/src/components/util/AutoScroll.vue index dcc12e9..c795030 100644 --- a/vue/src/components/util/AutoScroll.vue +++ b/vue/src/components/util/AutoScroll.vue @@ -36,7 +36,10 @@ let cachedScrollHeight = 0; function measureScrollHeight() { 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() {