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]>
This commit is contained in:
1 parent
61a8ca2c31
commit
cffc3013cd
1 file changed
+1
-1
@@ -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;
|
||||
|
||||
|
||||
Reference in new issue
Block a user