From 2c1cfbc701d3377e783f58505bee39c5cfdc9225 Mon Sep 17 00:00:00 2001 From: Charlotte Som Date: Wed, 05 Mar 2025 13:35:50 +0000 Subject: [PATCH] restore scrollTop maybe ? --- client/main.ts | 5 +++++ 1 file(s) changed, 5 insertion(s)(+), 0 deletion(s)(-) diff --git a/client/main.ts b/client/main.ts --- a/client/main.ts +++ b/client/main.ts @@ -16,8 +16,13 @@ if (textIndex <= start) start += affectedLength; if (textIndex <= end) end += affectedLength; + const scrollTop = textarea.scrollTop; + // TODO: check if scrolled to bottom + textarea.value = pt.render()[0]; textarea.setSelectionRange(start, end); + + textarea.scrollTop = scrollTop; }; const socket = new WebSocket("/api/connect"); -- tangled.sh