From a2d216a80d1429efe6bcb7a8a13613cccab343f2 Mon Sep 17 00:00:00 2001 From: Thanh Dodeur Date: Tue, 27 Oct 2020 14:52:55 +0000 Subject: [PATCH] [Fix] mail: ensures composer cleanup on message post MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Before this commit, the state of the composer was not properly saving its state when focusing out, which caused erroneous composer states in some corner cases, like when posting messages on mobile in some browsers. This commit fixes this issue. opw-2366374 closes odoo/odoo#60913 X-original-commit: 8e79fefdb9990a6480fdae2684e07799e5439b06 Signed-off-by: Alexandre Kühn (aku) Co-authored-by: Sébastien Theys --- .../mail/static/src/components/chat_window/chat_window.js | 6 ------ .../components/composer_text_input/composer_text_input.js | 1 + 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/addons/mail/static/src/components/chat_window/chat_window.js b/addons/mail/static/src/components/chat_window/chat_window.js index 46e60bbea54..0f8598257c3 100644 --- a/addons/mail/static/src/components/chat_window/chat_window.js +++ b/addons/mail/static/src/components/chat_window/chat_window.js @@ -278,12 +278,6 @@ class ChatWindow extends Component { * @private */ _onFocusout() { - if (this._inputRef.comp) { - this._inputRef.comp.focusout(); - } - if (this._threadRef.comp) { - this._threadRef.comp.focusout(); - } if (!this.chatWindow) { // ignore focus out due to record being deleted return; diff --git a/addons/mail/static/src/components/composer_text_input/composer_text_input.js b/addons/mail/static/src/components/composer_text_input/composer_text_input.js index 10cdd7ff0a7..068bdd303d4 100644 --- a/addons/mail/static/src/components/composer_text_input/composer_text_input.js +++ b/addons/mail/static/src/components/composer_text_input/composer_text_input.js @@ -186,6 +186,7 @@ class ComposerTextInput extends Component { * @private */ _onFocusoutTextarea() { + this.saveStateInStore(); this.composer.update({ hasFocus: false }); }