mirror of
https://github.com/wassname/chatGPTBox.git
synced 2026-07-10 08:18:25 +08:00
* Put the cursor back to input area after the answer generated * move inputbox focus to lonely useEffect --------- Co-authored-by: Jikai Xu <“jikai.xu@insigniafinancial.com.au”> Co-authored-by: josc146 <josStorer@outlook.com>
This commit is contained in:
@@ -12,6 +12,10 @@ export function InputBox({ onSubmit, enabled }) {
|
||||
updateRefHeight(inputRef)
|
||||
})
|
||||
|
||||
useEffect(() => {
|
||||
if (enabled) inputRef.current.focus()
|
||||
}, [enabled])
|
||||
|
||||
const onKeyDown = (e) => {
|
||||
e.stopPropagation()
|
||||
if (e.keyCode === 13 && e.shiftKey === false) {
|
||||
|
||||
Reference in New Issue
Block a user