Autofocus textarea on new conversation

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-09-10 14:14:59 -04:00
parent d8d01a5fff
commit 20d44bb3b3
2 changed files with 4 additions and 0 deletions
@@ -233,6 +233,7 @@ export const ChatScreen = ({ setAuthenticated, isAdmin }: ChatScreenProps) => {
pendingImage={pendingImage}
onImageSelect={handleImageSelect}
onClearImage={handleClearImage}
autoFocus
/>
</div>
</div>
@@ -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<HTMLInputElement>(null);
const textareaRef = useRef<HTMLTextAreaElement>(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 */}