disable sending on enter while composing (#1909)

Fixes #1899 #1497
This commit is contained in:
Audric Ackermann 2021-09-14 13:17:36 +10:00 committed by GitHub
parent c92baad736
commit a1f5706fea
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -796,8 +796,8 @@ class SessionCompositionBoxInner extends React.Component<Props, State> {
}
private async onKeyDown(event: any) {
if (event.key === 'Enter' && !event.shiftKey) {
// If shift, newline. Else send message.
if (event.key === 'Enter' && !event.shiftKey && !event.nativeEvent.isComposing) {
// If shift, newline. If in IME composing mode, leave it to IME. Else send message.
event.preventDefault();
await this.onSendMessage();
} else if (event.key === 'Escape' && this.state.showEmojiPanel) {