mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2026-01-08 14:29:15 +08:00
fix(Inputbar): do not reset selection on focus (#5866)
This commit is contained in:
parent
7e2f27c2f9
commit
dc24fecba5
@ -903,10 +903,8 @@ const Inputbar: FC<Props> = ({ assistant: _assistant, setActiveTopic, topic }) =
|
|||||||
styles={{ textarea: TextareaStyle }}
|
styles={{ textarea: TextareaStyle }}
|
||||||
onFocus={(e: React.FocusEvent<HTMLTextAreaElement>) => {
|
onFocus={(e: React.FocusEvent<HTMLTextAreaElement>) => {
|
||||||
setInputFocus(true)
|
setInputFocus(true)
|
||||||
const textArea = e.target
|
if (e.target.value.length === 0) {
|
||||||
if (textArea) {
|
e.target.setSelectionRange(0, 0)
|
||||||
const length = textArea.value.length
|
|
||||||
textArea.setSelectionRange(length, length)
|
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
onBlur={() => setInputFocus(false)}
|
onBlur={() => setInputFocus(false)}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user