[FIX] mail: prevent Safari from indefinitely focusing composer
`setSelectionRange()` on Safari has side-effect to focusing the input element, which is not the case in Chrome and Firefox. Task-2410311 closes odoo/odoo#62886 Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
This commit is contained in:
@@ -165,11 +165,13 @@ class ComposerTextInput extends Component {
|
||||
}
|
||||
this._textareaRef.el.value = this.composer.textInputContent;
|
||||
this._mirroredTextareaRef.el.value = this.composer.textInputContent;
|
||||
this._textareaRef.el.setSelectionRange(
|
||||
this.composer.textInputCursorStart,
|
||||
this.composer.textInputCursorEnd,
|
||||
this.composer.textInputSelectionDirection,
|
||||
);
|
||||
if (this.composer.hasFocus) {
|
||||
this._textareaRef.el.setSelectionRange(
|
||||
this.composer.textInputCursorStart,
|
||||
this.composer.textInputCursorEnd,
|
||||
this.composer.textInputSelectionDirection,
|
||||
);
|
||||
}
|
||||
this._updateHeight();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user