fix: send message on Enter keypress only when not in input method mode (#63)
This commit is contained in:
parent
96a386b9d6
commit
f326b47f6e
1 changed files with 5 additions and 1 deletions
|
|
@ -9,7 +9,11 @@ export function useEnterSubmit(): {
|
|||
const handleKeyDown = (
|
||||
event: React.KeyboardEvent<HTMLTextAreaElement>
|
||||
): void => {
|
||||
if (event.key === 'Enter' && !event.shiftKey) {
|
||||
if (
|
||||
event.key === 'Enter' &&
|
||||
!event.shiftKey &&
|
||||
!event.nativeEvent.isComposing
|
||||
) {
|
||||
formRef.current?.requestSubmit()
|
||||
event.preventDefault()
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue