fix(canvas-chat): reset textarea to baseline (not 0px) after send (core#2697) #2718
Reference in New Issue
Block a user
Delete Branch "fix/chat-textarea-reset-baseline"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Regression from the auto-grow textarea (#2700 feature 4)
After sending a message the input textarea collapses smaller than its original single-row height (just padding) until the next keystroke.
Root cause
The send-reset set
textareaRef.current.style.height = "0px"and never recomputed. Unlike the onChange auto-grow (which sets0pxthen immediately re-measuresscrollHeight), nothing re-measures after send, so the imperative0pxsticks until the next keypress.Fix
Clear the inline height (
style.height = "") instead of"0px"— dropping the override lets therows={1}natural height govern again, restoring the baseline immediately on send. ChatTab tests green.🤖 Generated with Claude Code
The auto-grow send-reset set the textarea's inline height to "0px" and never recomputed, so after sending the input collapsed to just its padding — far smaller than its original single-row size — until the next keystroke fired the onChange recompute. Clear the inline height instead (empty string) so the rows={1} natural height governs again, restoring the baseline immediately on send. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>APPROVED on head
2eeba14b30.Reviewed with the 5-axis lens. This is the correct narrow fix for the auto-grow send-reset regression: clearing
textareaRef.current.style.heightremoves the imperative override and lets therows={1}baseline govern again. That is safer than setting0px, because there is no post-send scrollHeight recompute until the next input event.Scope is one UI line plus explanatory comment; no server, persistence, auth, or data-flow changes. Security/performance risk is negligible. Targeted chat/canvas E2E statuses were green;
CI / Canvas (Next.js)was still pending at review time, so merge should wait for required CI to finish green./sop-ack
/sop-ack comprehensive-testing
/sop-ack local-postgres-e2e
/sop-ack staging-smoke
/sop-ack root-cause
/sop-ack five-axis-review
/sop-ack no-backwards-compat
/sop-ack memory-consulted
Code review is approved and the explicit SOP acks are posted (
acked: 7/7), but merge is still blocked bysop-checklist / all-items-acked: the PR body is missing the required filled SOP checklist sections (body-unfilled). Please add/fill the 7 body markers:Comprehensive testing performed,Local-postgres E2E run,Staging-smoke verified or pending,Root-cause not symptom,Five-Axis review walked,No backwards-compat shim / dead code added, andMemory consulted.