From 94236de63719a9ac5585f421f739244b0250fb6b Mon Sep 17 00:00:00 2001 From: JungEon Kim Date: Fri, 3 Apr 2020 03:36:25 +0900 Subject: [PATCH] Fix Hangul typing does not work properly compositionstart event may fire in the meantime because compositionend event is being processed asynchronously. Signed-off-by: JungEon Kim --- src/components/views/rooms/BasicMessageComposer.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/views/rooms/BasicMessageComposer.js b/src/components/views/rooms/BasicMessageComposer.js index 7042cdc00d..5b597e1999 100644 --- a/src/components/views/rooms/BasicMessageComposer.js +++ b/src/components/views/rooms/BasicMessageComposer.js @@ -203,9 +203,9 @@ export default class BasicMessageEditor extends React.Component { if (isSafari) { this._onInput({inputType: "insertCompositionText"}); } else { - setTimeout(() => { + Promise.resolve().then(() => { this._onInput({inputType: "insertCompositionText"}); - }, 0); + }); } }