diff --git a/src/chat-sender/chat-sender.tsx b/src/chat-sender/chat-sender.tsx index 48eb238e..c56b9dde 100644 --- a/src/chat-sender/chat-sender.tsx +++ b/src/chat-sender/chat-sender.tsx @@ -250,8 +250,6 @@ export default class ChatSender extends Component { onChange={this.handleChange} onKeyDown={this.handleKeyDown} onKeyUp={this.handleKeyUp} - onCompositionStart={this.handleCompositionStart} - onCompositionEnd={this.handleCompositionEnd} onFocus={this.handleFocus} onBlur={this.handleBlur} /> @@ -281,7 +279,7 @@ export default class ChatSender extends Component { private handleKeyDown = (e: KeyboardEvent) => { if (e.key === 'Shift') this.shiftDown = true; - if (e.key === 'Enter' && !this.shiftDown) { + if (e.key === 'Enter' && !this.shiftDown && !e.isComposing) { e.preventDefault(); this.clickSend(); } @@ -291,14 +289,6 @@ export default class ChatSender extends Component { if (e.key === 'Shift') this.shiftDown = false; }; - private handleCompositionStart = () => { - this.shiftDown = true; - }; - - private handleCompositionEnd = () => { - this.shiftDown = false; - }; - private handleFocus = () => { this.fire('focus', this.inputValue, { composed: true,