Merge pull request #1821 from copyhold/autofocus-text-input-when-start-new-chat
Autofocus text input when start new chat
This commit is contained in:
commit
51eeccfcde
@ -66,6 +66,9 @@ const ChatInput: React.FC = () => {
|
|||||||
setIsWaitingToSend(false)
|
setIsWaitingToSend(false)
|
||||||
sendChatMessage()
|
sendChatMessage()
|
||||||
}
|
}
|
||||||
|
if (textareaRef.current) {
|
||||||
|
textareaRef.current.focus()
|
||||||
|
}
|
||||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||||
}, [waitingToSendMessage, activeThreadId])
|
}, [waitingToSendMessage, activeThreadId])
|
||||||
|
|
||||||
@ -73,6 +76,7 @@ const ChatInput: React.FC = () => {
|
|||||||
if (textareaRef.current) {
|
if (textareaRef.current) {
|
||||||
textareaRef.current.style.height = '40px'
|
textareaRef.current.style.height = '40px'
|
||||||
textareaRef.current.style.height = textareaRef.current.scrollHeight + 'px'
|
textareaRef.current.style.height = textareaRef.current.scrollHeight + 'px'
|
||||||
|
textareaRef.current.focus()
|
||||||
}
|
}
|
||||||
}, [currentPrompt])
|
}, [currentPrompt])
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user