fix height bug

This commit is contained in:
Danny White committed 2026-02-10 14:08:10 +11:00
1 parent 2d4f2949f6
commit f0c9f77aac
1 file changed
+5 -8
@@ -22,14 +22,11 @@ const ExpandingTextArea = forwardRef<HTMLTextAreaElement, ExpandingTextAreaProps
const updateTextAreaHeight = (element: HTMLTextAreaElement | null) => {
if (!element) return
// Update the height
if (!value) {
element.style.height = 'auto'
element.style.minHeight = '36px'
} else {
element.style.height = 'auto'
element.style.height = element.scrollHeight + 'px'
}
// Match single-line input height (h-10 = 40px) so we don't shrink when typing; grow only when content wraps
const singleLineHeightPx = 40
element.style.height = 'auto'
const contentHeight = element.scrollHeight
element.style.height = Math.max(singleLineHeightPx, contentHeight) + 'px'
}
useLayoutEffect(() => {