From 7bda1c58ebf6a4306abbe24dffbef5028a954c82 Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Tue, 24 Sep 2019 15:36:46 +0200 Subject: [PATCH] better naming --- src/components/views/rooms/BasicMessageComposer.js | 6 +++--- src/components/views/rooms/EditMessageComposer.js | 2 +- src/components/views/rooms/SendMessageComposer.js | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/components/views/rooms/BasicMessageComposer.js b/src/components/views/rooms/BasicMessageComposer.js index 40142d4436..ac528f07eb 100644 --- a/src/components/views/rooms/BasicMessageComposer.js +++ b/src/components/views/rooms/BasicMessageComposer.js @@ -173,12 +173,12 @@ export default class BasicMessageEditor extends React.Component { // so trigger a model update after the composition is done by calling the input handler. // do this async though, as modifying the DOM from the compositionend event might confuse the composition. setTimeout(() => { - this._onInput({inputType: "insertCompositionText"}); + this._onInput({inputType: "insertCompositionText"}, true); }, 0); } - shouldIgnoreKeyDownEvents() { - return this._isIMEComposing; + isComposing(event) { + return !!(this._isIMEComposing || event.isComposing); } _onPaste = (event) => { diff --git a/src/components/views/rooms/EditMessageComposer.js b/src/components/views/rooms/EditMessageComposer.js index c744711f61..1a7abb45fb 100644 --- a/src/components/views/rooms/EditMessageComposer.js +++ b/src/components/views/rooms/EditMessageComposer.js @@ -127,7 +127,7 @@ export default class EditMessageComposer extends React.Component { } _onKeyDown = (event) => { - if (this._editorRef.shouldIgnoreKeyDownEvents()) { + if (this._editorRef.isComposing(event)) { return; } if (event.metaKey || event.altKey || event.shiftKey) { diff --git a/src/components/views/rooms/SendMessageComposer.js b/src/components/views/rooms/SendMessageComposer.js index d98a1a55cb..6fc53492d3 100644 --- a/src/components/views/rooms/SendMessageComposer.js +++ b/src/components/views/rooms/SendMessageComposer.js @@ -104,7 +104,7 @@ export default class SendMessageComposer extends React.Component { }; _onKeyDown = (event) => { - if (this._editorRef.shouldIgnoreKeyDownEvents()) { + if (this._editorRef.isComposing(event)) { return; } const hasModifier = event.altKey || event.ctrlKey || event.metaKey || event.shiftKey;