fix(web): stop the chat scroll bouncing on multiline input

The auto-resize reset the textarea to auto before measuring, which
collapsed it to one row for a frame. That resized the chat viewport,
the browser clamped its scroll to the old bottom, and the next input
scrolled back.

Measure the content in a hidden copy instead. The composer reports a
height change, and the room keeps the chat at the bottom only when the
reader is already there.

Typing and deleting lines now keeps the chat at the bottom without the
jump.
This commit is contained in:
vhaudiquet committed 2026-11-28 19:00:56 +01:00
1 parent f5087220da
commit ca333509a2
3 files changed
+78 -6

No files matched your search

+21
View File
@@ -1354,6 +1354,7 @@ button {
overflow-y: auto;
font-size: var(--fs-ui);
line-height: var(--lh-body);
overflow-wrap: anywhere;
scrollbar-width: thin;
}
@@ -1361,6 +1362,26 @@ button {
color: var(--faint);
}
.composer-sizer {
position: fixed;
top: -10000px;
left: -10000px;
height: 0;
min-height: 0;
max-height: none;
overflow: hidden;
visibility: hidden;
pointer-events: none;
border: 0;
padding: var(--sp-1) var(--sp-2);
font: inherit;
font-size: var(--fs-ui);
line-height: var(--lh-body);
white-space: pre-wrap;
overflow-wrap: anywhere;
resize: none;
}
.composer-actions {
display: flex;
align-items: center;