Merge pull request #493 from buster-so/big-nate/bus-1369-auto-select-chat

Big nate/bus 1369 auto select chat
This commit is contained in:
Nate Kelley 2025-07-14 08:47:01 -06:00 committed by GitHub
commit cfa91882c9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 9 additions and 1 deletions

View File

@ -1,4 +1,4 @@
import React, { type ChangeEvent, useMemo, useRef, useState } from 'react';
import React, { type ChangeEvent, useEffect, useMemo, useRef, useState } from 'react';
import { InputTextAreaButton } from '@/components/ui/inputs/InputTextAreaButton';
import { useMemoizedFn } from '@/hooks';
import { cn } from '@/lib/classMerge';
@ -32,6 +32,14 @@ export const ChatInput: React.FC = React.memo(() => {
setInputValue(e.target.value);
});
useEffect(() => {
if (hasChat) {
requestAnimationFrame(() => {
textAreaRef.current?.focus();
});
}
}, [hasChat, textAreaRef]);
return (
<div
className={cn(