fix(translate): Improve Enter key detection in translation input #2861
This commit is contained in:
parent
a25f4e90dd
commit
70eb0a9187
@ -140,7 +140,8 @@ const TranslatePage: FC = () => {
|
|||||||
}, [])
|
}, [])
|
||||||
|
|
||||||
const onKeyDown = (e: React.KeyboardEvent<HTMLTextAreaElement>) => {
|
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()
|
e.preventDefault()
|
||||||
onTranslate()
|
onTranslate()
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user