From cffc3013cd3b3309377efc1d46afebc52253b1a4 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Mon, 2 Mar 2026 18:26:03 +0000 Subject: [PATCH] fix: use consistent border-box measurement in composer ResizeObserver The initial height was seeded via getBoundingClientRect().height (border-box) but the ResizeObserver callback read entry.contentRect.height (content-box). This mismatch would cause a spurious height change detection on the first callback if the form element ever acquired padding or border. Use entry.borderBoxSize[0].blockSize (with contentRect fallback) to keep both measurements in border-box space. Co-authored-by: Julius Marminge --- apps/web/src/components/ChatView.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/web/src/components/ChatView.tsx b/apps/web/src/components/ChatView.tsx index 8dd15be5b1..2d250f2ec3 100644 --- a/apps/web/src/components/ChatView.tsx +++ b/apps/web/src/components/ChatView.tsx @@ -1335,7 +1335,7 @@ export default function ChatView({ threadId }: ChatViewProps) { const [entry] = entries; if (!entry) return; - const nextHeight = entry.contentRect.height; + const nextHeight = entry.borderBoxSize[0]?.blockSize ?? entry.contentRect.height; const previousHeight = composerFormHeightRef.current; composerFormHeightRef.current = nextHeight;