From fb97c9c49478ec47b7dec7963ad6fd15b4365da1 Mon Sep 17 00:00:00 2001 From: stonedDiscord Date: Wed, 22 Nov 2023 18:00:52 +0100 Subject: fix autoscroll --- webAO/client/appendICLog.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'webAO/client') diff --git a/webAO/client/appendICLog.ts b/webAO/client/appendICLog.ts index f8b7852..bb95920 100644 --- a/webAO/client/appendICLog.ts +++ b/webAO/client/appendICLog.ts @@ -48,10 +48,8 @@ export function appendICLog( const clientLog = document.getElementById("client_log")!; clientLog.appendChild(entry); - /* This is a little buggy - some troubleshooting might be desirable */ - if (clientLog.scrollTop > clientLog.scrollHeight - 800) { - clientLog.scrollTop = clientLog.scrollHeight; - } + if (clientLog.scrollTop+clientLog.offsetHeight+50>clientLog.scrollHeight) + clientLog.scrollTo(0, clientLog.scrollHeight); setLastICMessageTime(new Date()); } \ No newline at end of file -- cgit