Add autofocus to text boxes

This commit is contained in:
Jack Kingsman
2026-04-06 21:59:46 -07:00
parent eeaa11b8b0
commit ca7349a1a8
6 changed files with 178 additions and 108 deletions

View File

@@ -44,6 +44,7 @@ type LimitState = 'normal' | 'warning' | 'danger' | 'error';
export interface MessageInputHandle {
appendText: (text: string) => void;
focus: () => void;
}
export const MessageInput = forwardRef<MessageInputHandle, MessageInputProps>(function MessageInput(
@@ -60,6 +61,9 @@ export const MessageInput = forwardRef<MessageInputHandle, MessageInputProps>(fu
// Focus the input after appending
inputRef.current?.focus();
},
focus: () => {
inputRef.current?.focus();
},
}));
// Calculate character limits based on conversation type