From 04d859097f98543b65b9903754edaf29198b654e Mon Sep 17 00:00:00 2001 From: e-roy Date: Sun, 7 Jan 2024 05:43:36 -0500 Subject: [PATCH] bug:fix height issue --- src/components/CommonForm.tsx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/components/CommonForm.tsx b/src/components/CommonForm.tsx index 73f3f1e..c3193a5 100644 --- a/src/components/CommonForm.tsx +++ b/src/components/CommonForm.tsx @@ -70,8 +70,7 @@ export const CommonForm: React.FC = ({ const handleTextAreaInput = useCallback( (event: React.ChangeEvent) => { onInputChange(event); - const target = event.currentTarget; - setTextareaHeight(`${target.scrollHeight}px`); + adjustTextareaHeight(event.currentTarget); }, [onInputChange] ); @@ -102,7 +101,7 @@ export const CommonForm: React.FC = ({ onKeyDown={handleKeyPress} style={{ height: textareaHeight }} rows={1} - className="flex-1 p-2 resize-none overflow-hidden min-h-8 rounded" + className="flex-1 p-2 resize-none min-h-8 rounded max-h-[50vh]" placeholder={placeholder} />