mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2025-12-25 03:10:08 +08:00
fix(translate): Improve Enter key detection in translation input #2861
This commit is contained in:
parent
59edb7eba5
commit
a4a4fbdd33
@ -140,7 +140,8 @@ const TranslatePage: FC = () => {
|
||||
}, [])
|
||||
|
||||
const onKeyDown = (e: React.KeyboardEvent<HTMLTextAreaElement>) => {
|
||||
if (e.key === 'Enter' && !e.shiftKey && !e.ctrlKey && !e.metaKey) {
|
||||
const isEnterPressed = e.keyCode == 13
|
||||
if (isEnterPressed && !e.shiftKey && !e.ctrlKey && !e.metaKey) {
|
||||
e.preventDefault()
|
||||
onTranslate()
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user