Commit 12cf0f4
authored
🤖 fix: chat input initial size bug (#850)
The chat input could appear way too big vertically on initial app
launch, then collapse to correct size when text was entered or window
was resized.
**Root cause:** `useEffect` runs asynchronously after paint, so the
initial `scrollHeight` measurement could happen before layout settled,
resulting in an incorrect (too large) height.
**Fix:** Switch to `useLayoutEffect` which runs synchronously after DOM
mutations but before the browser paints, ensuring accurate initial
height measurement.
---
_Generated with `mux`_1 parent 735e650 commit 12cf0f4
1 file changed
+6
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
67 | | - | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
68 | 70 | | |
69 | 71 | | |
| 72 | + | |
70 | 73 | | |
71 | 74 | | |
| 75 | + | |
72 | 76 | | |
73 | 77 | | |
74 | 78 | | |
| |||
0 commit comments