Skip to content

Commit cffc301

Browse files
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 <[email protected]>
1 parent 61a8ca2 commit cffc301

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎apps/web/src/components/ChatView.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1335,7 +1335,7 @@ export default function ChatView({ threadId }: ChatViewProps) {
13351335
const [entry] = entries;
13361336
if (!entry) return;
13371337

1338-
const nextHeight = entry.contentRect.height;
1338+
const nextHeight = entry.borderBoxSize[0]?.blockSize ?? entry.contentRect.height;
13391339
const previousHeight = composerFormHeightRef.current;
13401340
composerFormHeightRef.current = nextHeight;
13411341

0 commit comments

Comments
 (0)