ignore keydown events while doing IME composition

This commit is contained in:
Bruno Windels
2019-09-24 15:32:30 +02:00
parent 4d151722ff
commit 9f47fad305
3 changed files with 8 additions and 0 deletions
@@ -104,6 +104,9 @@ export default class SendMessageComposer extends React.Component {
};
_onKeyDown = (event) => {
if (this._editorRef.shouldIgnoreKeyDownEvents()) {
return;
}
const hasModifier = event.altKey || event.ctrlKey || event.metaKey || event.shiftKey;
if (event.key === "Enter" && !hasModifier) {
this._sendMessage();