diff --git a/app/InputFrontend.tsx b/app/InputFrontend.tsx index c3cdea8..cf9dffc 100644 --- a/app/InputFrontend.tsx +++ b/app/InputFrontend.tsx @@ -14,19 +14,28 @@ const InputFrontend = React.forwardRef( setInputValue(e.target.value); }; + const handleKeyDown = (event: React.KeyboardEvent) => { + if (event.key === 'Enter') { + onSendClick(inputValue); // Call the function passed via props + setInputValue(''); // Optionally clear input after submission + event.preventDefault(); // Prevent default action (e.g., form submission) + } + }; + return ( -
+
- -