diff options
| author | stonedDiscord <Tukz@gmx.de> | 2023-11-22 18:00:52 +0100 |
|---|---|---|
| committer | stonedDiscord <Tukz@gmx.de> | 2023-11-22 18:00:52 +0100 |
| commit | fb97c9c49478ec47b7dec7963ad6fd15b4365da1 (patch) | |
| tree | e325ac64f3c62891850d2ea4916cf35b63a384a9 | |
| parent | dc3c9cc7bc2725552661ea27158720305d74cdd1 (diff) | |
fix autoscroll
| -rw-r--r-- | webAO/client/appendICLog.ts | 6 |
1 files changed, 2 insertions, 4 deletions
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 |
