[Fix] mail: ensures composer cleanup on message post

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) <aku@odoo.com>
Co-authored-by: Sébastien Theys <seb@odoo.com>
This commit is contained in:
Thanh Dodeur
2020-10-28 14:56:47 +00:00
co-authored by Sébastien Theys
parent abb7d2dab9
commit a2d216a80d
2 changed files with 1 additions and 6 deletions
@@ -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;
@@ -186,6 +186,7 @@ class ComposerTextInput extends Component {
* @private
*/
_onFocusoutTextarea() {
this.saveStateInStore();
this.composer.update({ hasFocus: false });
}