diff --git a/webapp/chat-app/src/components/InputArea.tsx b/webapp/chat-app/src/components/InputArea.tsx index 2de86d14..fcbc8c27 100644 --- a/webapp/chat-app/src/components/InputArea.tsx +++ b/webapp/chat-app/src/components/InputArea.tsx @@ -75,6 +75,7 @@ const InputArea = memo(function InputArea({onSendMessage}: InputAreaProps) { const [message, setMessage] = useState(''); const config = useSelector((state: RootState) => state.config); const [isSubmitting, setIsSubmitting] = useState(false); + const textAreaRef = React.useRef(null); const handleSubmit = useCallback((e: React.FormEvent) => { e.preventDefault(); @@ -115,6 +116,8 @@ const InputArea = memo(function InputArea({onSendMessage}: InputAreaProps) { React.useEffect(() => { log('Component mounted', {configState: config}); + // Focus the textarea when component mounts + textAreaRef.current?.focus(); return () => { log('Component unmounting'); }; @@ -125,6 +128,7 @@ const InputArea = memo(function InputArea({onSendMessage}: InputAreaProps) {