Fix AutoScroll stopping a viewport short of the end
Deploy with Docker Compose / deploy (push) Successful in 24s
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:
@@ -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() {
|
||||||
|
|||||||
Reference in New Issue
Block a user