|
@@ -49,6 +49,7 @@ const ChatInput: FC<ChatInputProps> = ({
|
|
|
const { t } = useTranslation()
|
|
|
const { notify } = useContext(ToastContext)
|
|
|
const [voiceInputShow, setVoiceInputShow] = useState(false)
|
|
|
+ const textAreaRef = useRef<HTMLTextAreaElement>(null)
|
|
|
const {
|
|
|
files,
|
|
|
onUpload,
|
|
@@ -176,6 +177,7 @@ const ChatInput: FC<ChatInputProps> = ({
|
|
|
)
|
|
|
}
|
|
|
<Textarea
|
|
|
+ ref={textAreaRef}
|
|
|
className={`
|
|
|
block w-full px-2 pr-[118px] py-[7px] leading-5 max-h-none text-sm text-gray-700 outline-none appearance-none resize-none
|
|
|
${visionConfig?.enabled && 'pl-12'}
|
|
@@ -234,7 +236,10 @@ const ChatInput: FC<ChatInputProps> = ({
|
|
|
voiceInputShow && (
|
|
|
<VoiceInput
|
|
|
onCancel={() => setVoiceInputShow(false)}
|
|
|
- onConverted={text => setQuery(text)}
|
|
|
+ onConverted={(text) => {
|
|
|
+ setQuery(text)
|
|
|
+ textAreaRef.current?.focus()
|
|
|
+ }}
|
|
|
/>
|
|
|
)
|
|
|
}
|