mirror of https://github.com/langgenius/dify.git
fix edit input mouse pos
This commit is contained in:
parent
ea17f41b5b
commit
e2547413d3
|
|
@ -206,6 +206,17 @@ export const MentionInput: FC<MentionInputProps> = memo(({
|
|||
resetMentionState()
|
||||
}, [value, resetMentionState])
|
||||
|
||||
useEffect(() => {
|
||||
if (autoFocus && textareaRef.current) {
|
||||
const textarea = textareaRef.current
|
||||
setTimeout(() => {
|
||||
textarea.focus()
|
||||
const length = textarea.value.length
|
||||
textarea.setSelectionRange(length, length)
|
||||
}, 0)
|
||||
}
|
||||
}, [autoFocus])
|
||||
|
||||
return (
|
||||
<>
|
||||
<div className={cn('relative flex items-center', className)}>
|
||||
|
|
|
|||
Loading…
Reference in New Issue