Do not send messages when confirming an input method selection
When using a CJK input method, the enter key is used to confirm the current conversion, so it shouldn't send the message yet. Normally this can be checked with the isComposing property of the native event, but that doesn't work on Safari on macOS. Instead, check for keyCode 229, which is what you get when confirming conversions, and ignore it.
This commit is contained in:
parent
e446fc47ce
commit
d57dcb5417
1 changed files with 1 additions and 1 deletions
|
@ -296,7 +296,7 @@ function RoomViewInput({
|
||||||
roomsInput.cancelReplyTo(roomId);
|
roomsInput.cancelReplyTo(roomId);
|
||||||
setReplyTo(null);
|
setReplyTo(null);
|
||||||
}
|
}
|
||||||
if (e.key === 'Enter' && e.shiftKey === false) {
|
if (e.key === 'Enter' && e.shiftKey === false && e.keyCode !== 229) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
sendMessage();
|
sendMessage();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue