mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2025-12-28 13:31:32 +08:00
fix(translate): prevent translation from being triggered unexpectedly during IME composition (#7968)
fix(translate): 修复在输入法组合文字时意外触发翻译的问题
This commit is contained in:
parent
8f38422e7f
commit
fbf89b3f0a
@ -514,7 +514,7 @@ const TranslatePage: FC = () => {
|
||||
|
||||
const onKeyDown = (e: React.KeyboardEvent<HTMLTextAreaElement>) => {
|
||||
const isEnterPressed = e.key === 'Enter'
|
||||
if (isEnterPressed && !e.shiftKey && !e.ctrlKey && !e.metaKey) {
|
||||
if (isEnterPressed && !e.nativeEvent.isComposing && !e.shiftKey && !e.ctrlKey && !e.metaKey) {
|
||||
e.preventDefault()
|
||||
onTranslate()
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user