From 60aa0035a79d1e57d1ae38da4bc52e808495bd7c Mon Sep 17 00:00:00 2001 From: Hadi Nategh Date: Thu, 29 Sep 2022 11:27:47 +0200 Subject: [PATCH] Try to set focus back to plain text area when replying to a plain text mail --- mail/js/app.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/mail/js/app.js b/mail/js/app.js index 3d0ef86f61..8107fc5fe2 100644 --- a/mail/js/app.js +++ b/mail/js/app.js @@ -361,7 +361,13 @@ app.classes.mail = AppJS.extend( // focus jQuery(plainText.getDOMNode()).focus(); // get the cursor to the top of the textarea - if (typeof plainText.getDOMNode().setSelectionRange !='undefined' && !jQuery(plainText.getDOMNode()).is(":hidden")) plainText.getDOMNode().setSelectionRange(0,0); + if (typeof plainText.getDOMNode().setSelectionRange !='undefined' && !jQuery(plainText.getDOMNode()).is(":hidden")) + { + setTimeout(function(){ + plainText.getDOMNode().setSelectionRange(0,0) + plainText.focus(); + }, 2000); + } } else if(textAreaWidget && textAreaWidget.tinymce) {