Autofocus textarea on new conversation
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -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 */}
|
||||
|
||||
Reference in New Issue
Block a user