From d498f899aa2ef81acbcd035896b9fcc912e4d52b Mon Sep 17 00:00:00 2001 From: Julien Giannone Date: Fri, 20 Nov 2020 07:47:37 +0000 Subject: [FIX] mail: fix text selection in composer using SHIFT and arrow keys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This commit corrects the faulty SHIFT + ArrowKey selection behavior. task-2388650 closes odoo/odoo#62059 Signed-off-by: Alexandre Kühn (aku) --- .../src/components/composer_text_input/composer_text_input.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'addons/mail/static/src/components/composer_text_input') 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 5afb99c4990..38b6cf30014 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 @@ -87,8 +87,9 @@ class ComposerTextInput extends Component { saveStateInStore() { this.composer.update({ textInputContent: this._getContent(), - textInputCursorStart: this._getSelectionStart(), textInputCursorEnd: this._getSelectionEnd(), + textInputCursorStart: this._getSelectionStart(), + textInputSelectionDirection: this._textareaRef.el.selectionDirection, }); } @@ -149,7 +150,8 @@ class ComposerTextInput extends Component { this._textareaRef.el.value = this.composer.textInputContent; this._textareaRef.el.setSelectionRange( this.composer.textInputCursorStart, - this.composer.textInputCursorEnd + this.composer.textInputCursorEnd, + this.composer.textInputSelectionDirection, ); this._updateHeight(); } -- cgit v1.2.3