fix(web): keep agent transcript pinned while typing
This commit is contained in:
@@ -288,7 +288,11 @@ export function AgentConversation({ room, onOpenSidebar, isVisible = true }: Pro
|
||||
useLayoutEffect(() => {
|
||||
const textarea = textareaRef.current;
|
||||
if (!textarea) return;
|
||||
textarea.style.height = "0px";
|
||||
// scrollHeight reflects the full draft even when the textarea is already
|
||||
// capped. Avoid collapsing a focused field to its minimum height while
|
||||
// measuring: the browser may scroll the enclosing transcript to reveal its
|
||||
// caret, and no ResizeObserver can correct that transient scroll once the
|
||||
// field returns to the same capped height.
|
||||
textarea.style.height = `${Math.min(156, Math.max(46, textarea.scrollHeight))}px`;
|
||||
}, [draft]);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user