From fccee296a5c915e77f82f4b22b778b55c49356d5 Mon Sep 17 00:00:00 2001 From: Bruno Charest Date: Tue, 16 Jun 2026 07:19:08 -0400 Subject: [PATCH] =?UTF-8?q?fix:=20Forge=20=E2=80=94=20preserver=20scroll?= =?UTF-8?q?=20position=20pendant=20autoHeight=20(empeche=20saut=20du=20cur?= =?UTF-8?q?seur)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/editor-poc.html | 3 +++ 1 file changed, 3 insertions(+) diff --git a/frontend/editor-poc.html b/frontend/editor-poc.html index 265aa37..009dc01 100644 --- a/frontend/editor-poc.html +++ b/frontend/editor-poc.html @@ -1337,11 +1337,14 @@ body { font-family: var(--sans); background: var(--bg); color: var(--text); heig // ---- Auto-height textarea (fill available space, grow beyond) ---- function autoHeight() { + var st = ta.scrollTop; ta.style.height = 'auto'; var contentH = ta.scrollHeight; // Minimum: fill the editor-wrap's visible area minus padding var wrapH = editorWrap.clientHeight - 48; ta.style.height = Math.max(contentH, wrapH) + 'px'; + // Restore scroll position: prevent cursor jump on every keystroke + ta.scrollTop = st; } ta.addEventListener('mouseup', function() { setTimeout(showBubble, 50); }); // Bubble follows cursor on any selection change (keyboard too)