Skip to content

Commit

Permalink
re add resizing input are
Browse files Browse the repository at this point in the history
  • Loading branch information
anirudTT committed Feb 24, 2025
1 parent 42a1771 commit 69b6130
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions app/frontend/src/components/chatui/InputArea.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ export default function InputArea({

const handleTextAreaInput = (e: React.ChangeEvent<HTMLTextAreaElement>) => {
setTextInput(e.target.value);
adjustTextareaHeight();
};

const handleKeyPress = (e: React.KeyboardEvent<HTMLTextAreaElement>) => {
Expand Down Expand Up @@ -225,6 +226,12 @@ export default function InputArea({
if (files) handleFileUpload(Array.from(files));
};

useEffect(() => {
adjustTextareaHeight();
window.addEventListener("resize", adjustTextareaHeight);
return () => window.removeEventListener("resize", adjustTextareaHeight);
}, [textInput]);

return (
<>
<AlertDialog open={showReplaceDialog} onOpenChange={setShowReplaceDialog}>
Expand Down

0 comments on commit 69b6130

Please sign in to comment.