diff --git a/raggr-frontend/src/components/ChatScreen.tsx b/raggr-frontend/src/components/ChatScreen.tsx index d848350..d74e054 100644 --- a/raggr-frontend/src/components/ChatScreen.tsx +++ b/raggr-frontend/src/components/ChatScreen.tsx @@ -233,6 +233,7 @@ export const ChatScreen = ({ setAuthenticated, isAdmin }: ChatScreenProps) => { pendingImage={pendingImage} onImageSelect={handleImageSelect} onClearImage={handleClearImage} + autoFocus /> diff --git a/raggr-frontend/src/components/MessageInput.tsx b/raggr-frontend/src/components/MessageInput.tsx index 778897d..b61d11a 100644 --- a/raggr-frontend/src/components/MessageInput.tsx +++ b/raggr-frontend/src/components/MessageInput.tsx @@ -15,6 +15,7 @@ type MessageInputProps = { pendingImage: File | null; onImageSelect: (file: File) => void; onClearImage: () => void; + autoFocus?: boolean; }; export const MessageInput = React.memo( @@ -30,6 +31,7 @@ export const MessageInput = React.memo( pendingImage, onImageSelect, onClearImage, + autoFocus, }: MessageInputProps) => { const fileInputRef = useRef(null); const textareaRef = useRef(null); @@ -102,6 +104,7 @@ export const MessageInput = React.memo( rows={2} placeholder="Ask Simba anything..." className="min-h-[60px] max-h-40 overflow-y-auto" + autoFocus={autoFocus} /> {/* Hidden file input */}