fix(ui): textarea auto-expands instead of scrolling

This commit is contained in:
2026-07-09 15:55:00 -04:00
parent 5d37fb899d
commit a7646481a4
+7 -2
View File
@@ -546,7 +546,12 @@ export const MessageInput = forwardRef<HTMLTextAreaElement, MessageInputProps>(f
placeholder={isDragOver ? "Drop file here..." : placeholder}
rows={1}
disabled={disabled}
className={`w-full bg-transparent outline-none border-none resize-none overflow-y-auto max-h-32 text-[14px] leading-snug py-1 font-mono ${isDragOver ? "bg-gb-bg-t" : ""}`}
className={`w-full bg-transparent outline-none border-none resize-none overflow-hidden text-[14px] leading-snug py-1 font-mono ${isDragOver ? "bg-gb-bg-t" : ""}`}
onInput={(e) => {
const el = e.currentTarget;
el.style.height = 'auto';
el.style.height = el.scrollHeight + 'px';
}}
/>
) : (
<div
@@ -561,7 +566,7 @@ export const MessageInput = forwardRef<HTMLTextAreaElement, MessageInputProps>(f
}
}}
data-placeholder={isDragOver ? "Drop file here..." : placeholder}
className={`w-full outline-none resize-none overflow-y-auto max-h-32 text-[14px] leading-snug py-1 font-mono
className={`w-full outline-none resize-none overflow-hidden text-[14px] leading-snug py-1 font-mono
before:content-[attr(data-placeholder)] before:text-gb-fg-f before:opacity-60
empty:before:block before:hidden
${isDragOver ? "bg-gb-bg-t" : ""}