Bugzilla@Mozdev – Bug 26465
Composer does not focus into body of mail
Last modified: 2018-05-24 14:43:51
You need to log in before you can comment on or make changes to this bug.
When forwarding or replying, the focus should be in the body of the email, but it is somewhere else on the compose window. I can use Shift+Tab to get the cursor where it should be. My template uses the %cursor% code in it. This was not a problem with TB 52.
I should add that I'm using version 1.5pre69
Could be another Add-on, but I need to test this on daily first. It may be a little early for posting this bug as Tb 58 is probably going to change very soon again.
My other limited add-ons are: MinimizeToTray revived (MinTrayR); Open With; QuickFolders; Restart Thunderbird; and Xpunge. I've used them all together without issues for a long time and after disabling them all except SmartTemplate4, the issue still persists. When I disable SmartTemplate4, the cursor is in the expected location. No problem if this is too early for reporting, but it's certainly not the expected behavior.
A quick follow up that the same issue is happening in 58b3
tested on Tb 58 beta3. in my case the editor does focus to the top of the document (but ignores my %cursor% variable in all cases) Debugging is, I found that apparently the false re-focusing (or in your case not focusing at all) is happening after SmartTemplate4 has processed the NotifyComposeBodyReady event. So it is due to some change within the Thunderbird code base, which must do additional processing after the NotifyComposeBodyReeady event. I guess we need to raise a bug with the Thunderbird bugzilla.
(In reply to comment #5) > tested on Tb 58 beta3. in my case the editor does focus to the top of the > document (but ignores my %cursor% variable in all cases) > > Debugging is, I found that apparently the false re-focusing (or in your case > not focusing at all) is happening after SmartTemplate4 has processed the > > NotifyComposeBodyReady > > event. So it is due to some change within the Thunderbird code base, which must > do additional processing after the NotifyComposeBodyReeady event. I guess we > need to raise a bug with the Thunderbird bugzilla. > I raised: https://bugzilla.mozilla.org/show_bug.cgi?id=1431059 please add your own observations/ test cases / votes there.
I've just updated SmartTemplate and I experience the same problem with lost focus on Thunderbird 52.7.0 (just updated from 52.6.0). It seems it is a problem with the latest version of SmartTemplate.
Update: I downgraded to version 1.4 and it works fine. The problem is only in the version 1.5
(In reply to comment #8) > Update: I downgraded to version 1.4 and it works fine. The problem is only in > the version 1.5 > I can't reproduce the issue even with version 1.5. Can you temporarily disable all other ADd-ons to rule out side effects?
Created an attachment (id=8443) [details] 1.5.1 prerelease 16 can you check if it still happens in this version please?
(In reply to comment #10) > Created an attachment (id=8443) [details] [details] > 1.5.1 prerelease 16 > > can you check if it still happens in this version please? > No change. Testing on clean Win10, fresh new Thunderbird 52.7.0 without any addons, no settings changed, clean SmartTemplate.
(In reply to comment #11) > (In reply to comment #10) > > Created an attachment (id=8443) [details] [details] [details] > > 1.5.1 prerelease 16 > > > > can you check if it still happens in this version please? > > > > No change. > Testing on clean Win10, fresh new Thunderbird 52.7.0 without any addons, no > settings changed, clean SmartTemplate. > Can you try with forwarding? If it still happens increase the time in about.config extensions.smartTemplate4.forwardInlineImg.delay = 2000
(In reply to comment #12) > (In reply to comment #11) > > (In reply to comment #10) > > > Created an attachment (id=8443) [details] [details] [details] [details] > > > 1.5.1 prerelease 16 > > > > > > can you check if it still happens in this version please? > > > > > > > No change. > > Testing on clean Win10, fresh new Thunderbird 52.7.0 without any addons, no > > settings changed, clean SmartTemplate. > > > > Can you try with forwarding? If it still happens increase the time in > about.config > > extensions.smartTemplate4.forwardInlineImg.delay = 2000 > Also, any messages in error console?
> Can you try with forwarding? If it still happens increase the time in > about.config > > extensions.smartTemplate4.forwardInlineImg.delay = 2000 > I have just tried both reply/forward with default (200) and 2000 delay. No difference. Error console: (translated) window.controllers is outdated. Do not use UA detection TypeError: this.NotifyComposeBodyReadyReply is not a function MsgComposeCommands.js:319:7
Created an attachment (id=8444) [details] 1.5.1 prerelease 17 Added a forced focus on the editor after the template was inserted.
*** Bug 26520 has been marked as a duplicate of this bug. ***
Created an attachment (id=8445) [details] 1.5.1 prerelease 19 When a new Email is written (e.g. with CTRL+N) then the focus is expected in the "To:" field. Pre17 _always_ forced focus into the Email Body. This version fixes this behavior and puts focus into "To" when creating a new Email.
Using TB 60.0b4, prerelease 19 and setting the extensions.smartTemplate4.forwardInlineImg.delay to 2000, I'm only getting an issue with forwarding emails. Two problems: Focus is on the body of the email, not the "To" field and I've set my template to have a return between the cursor mark and my name, but it is ignored. Everything else seems to work fine throughout TB so far.
(In reply to comment #17) > Created an attachment (id=8445) [details] [details] > 1.5.1 prerelease 19 > > When a new Email is written (e.g. with CTRL+N) then the focus is expected in > the "To:" field. Pre17 _always_ forced focus into the Email Body. > > This version fixes this behavior and puts focus into "To" when creating a new > Email. > "Reply" works fine in this release.
Created an attachment (id=8446) [details] 1.5.1 prerelease 21 Ok - I didn't know we need to focus on "to:" in the "forwarding" case. Fixed version attached.
Working great!
Fixed for Release 1.5.1
I've found one more instance of this bug! When opening an email from the templates folder, it focuses at the beginning of the body text instead of the "To" field. This should be done even if there is an email address already in the template to allow for additional email addresses. TB 60.0b4, 1.5.1 prerelease 21
Sorry, but SmartTemplate4 1.5.1 creates an additional bug for me. My template for both Reply and Forward is as follows: ------------------------------------ <blockquote cite="" type="cite" style="border: 0pt none ; margin-top: 0pt; margin-bottom: 0pt; margin-left: 0pt; padding-left: 0pt; padding-right: 0pt; padding-bottom: 0pt;"> <div style="margin-top: 1.5em; margin-bottom: 1.25em;"> <hr noshade="noshade" color="#C0C0C0" size="1" width="100%"> </div> <div style="margin-bottom: 1em; color: black; text-decoration:none !important; size: medium;"> <b>To: </b>%to(initial)%<br> [[<b>CC: </b>%cc(name,bracketMail())%<br>]] [[<b>BCC: </b>%bcc(name,bracketMail())%<br>]] <b>From: </b>%from(name,bracketMail())%<br> [[<b>Reply to: </b>%reply-to(mail)%<br>]] <b>Date: </b>%X:=sent% %a% %e% %b% %Y% %H%:%M%:%S% %date_tz%<br> <b>Subject: </b>%subject% </div> </blockquote> ------------------------------------ This works fine with version 1.5.0; but; with the new version; an additional carriage return is inserted in the body of the e-mail as soon as I type a character. This happens with replies, not forwards (not sure why, but would seem related to this thread). It should be immediately visible to anyone using my template and comparing how it works with 1.5.0 compared to 1.5.1, but I can send a video if needed. Will it be possible to fix this? Incidentally, I personally much prefer the cursor to immediately focus on the body text, rather than on the to/cc/bcc headers. This is especially true of replies; after all, in most cases, I don't add recipients to straightforward replies. Focusing on the headers is a not only annoying, but a complete waste of time. Maybe an idea would be to add an option allowing a choice of where to focus the cursor? TB 52.7 macOS 10.13.4
Created an attachment (id=8460) [details] 1.5.2 prerelease 45 This one addresses the "Template" case. Apparently no processing happens in this case. I probably need to raise a separate bug for enabling processing in a Template from Thunderbird.
(In reply to comment #25) > Created an attachment (id=8460) [details] [details] > 1.5.2 prerelease 45 > > This one addresses the "Template" case. Apparently no processing happens in > this case. I probably need to raise a separate bug for enabling processing in a > Template from Thunderbird. > Works perfectly. Thank you.
(In reply to comment #26) > (In reply to comment #25) > > Created an attachment (id=8460) [details] [details] [details] > > 1.5.2 prerelease 45 > > > > This one addresses the "Template" case. Apparently no processing happens in > > this case. I probably need to raise a separate bug for enabling processing in a > > Template from Thunderbird. > > > > Works perfectly. Thank you. > Cool. Currently working on a version that allows using %variables% within the templates, but it's going to take a little while. It's tricky :)
(In reply to comment #27) > > Cool. Currently working on a version that allows using %variables% within the > templates, but it's going to take a little while. It's tricky :) > Related: [Bug 26536] either I am going to land this in 1.5.2 or make a version jump to 1.6 which rolls in all maintenance fixes.
Using SmartTemplate 1.5.0 or 1.5.1, when I start a new text the cursor defaults to the end of the Reply-To field. I just upgraded to Ubuntu 18.04 (TB 52.7.0), and since then this behavior consistently occurs, even with all other add-ons disabled. Expected behavior: When I start a new text, the focus should default to the "To" field.
(In reply to comment #29) > Using SmartTemplate 1.5.0 or 1.5.1, when I start a new text the cursor defaults > to the end of the Reply-To field. > > I just upgraded to Ubuntu 18.04 (TB 52.7.0), and since then this behavior > consistently occurs, even with all other add-ons disabled. > > Expected behavior: When I start a new text, the focus should default to the > "To" field. > Did you test 1.5.2 pre 45, which is attached in comment #25 ?
(In reply to comment #30) > (In reply to comment #29) > > Using SmartTemplate 1.5.0 or 1.5.1, when I start a new text the cursor defaults > > to the end of the Reply-To field. > > > > I just upgraded to Ubuntu 18.04 (TB 52.7.0), and since then this behavior > > consistently occurs, even with all other add-ons disabled. > > > > Expected behavior: When I start a new text, the focus should default to the > > "To" field. > > > > Did you test 1.5.2 pre 45, which is attached in comment #25 ? > Yes, I did. With all other add-ons disabled, the behavior persists.
I tr(In reply to comment #31) > (In reply to comment #30) > > (In reply to comment #29) > > > Using SmartTemplate 1.5.0 or 1.5.1, when I start a new text the cursor defaults > > > to the end of the Reply-To field. > > > > > > I just upgraded to Ubuntu 18.04 (TB 52.7.0), and since then this behavior > > > consistently occurs, even with all other add-ons disabled. > > > > > > Expected behavior: When I start a new text, the focus should default to the > > > "To" field. > > > > > > > Did you test 1.5.2 pre 45, which is attached in comment #25 ? > > > > Yes, I did. With all other add-ons disabled, the behavior persists. > I tried reproducing this with different settings (HTML email, Text only Email, With and without Stationery Support) but I cannot reproduce it: the focus for new emails is always in the "to:" element on the address widget. I suggest you create a debug log with the latest version; I will attach a patched version of console here so you can create a text only log. Please follow the instructions here: http://smarttemplate4.mozdev.org/support.html 1. ON SmartTemplate4 settings Advanced > Advanced Settings Tab 2. Make sure to enable chrome, disable Content and clear the error console before hitting the "Write" button Final expected output looks something like this (I am interested in anything following NotifyComposeBodyReady): SmartTemplate4 19:43:21.366 [1308 ms] NotifyComposeBodyReady ---------- SmartTemplate4 19:43:21.366 [0 ms] NotifyComposeBodyReady: Stationery 0.8+ - no action required. ---------- SmartTemplate4 19:43:21.534 [168 ms] SmartTemplate4.notifyComposeBodyReady() Stationery is active Template used is:blank ---------- SmartTemplate4 19:43:21.534 [0 ms] readSignatureFile() Trying to read attached signature file: sig-ag-amo-2017.html at: C:\Users\Axel\Documents\Thunderbird\Signatures\sig-ag-amo-2017.html ---------- SmartTemplate4 {IMAGES} 19:43:21.540 [6 ms] getFileAsDataURI() filename=thunderbird_blog2.png ---------- SmartTemplate4 {IMAGES} 19:43:21.540 [0 ms] opening image stream... ---------- SmartTemplate4 {IMAGES} 19:43:21.540 [0 ms] stream read. Adding data, including encoded filename part: thunderbird_blog2.png ---------- SmartTemplate4 19:43:21.542 [2 ms] getLocale() returns: en-IE
Created an attachment (id=8481) [details] console² patched version This is a patched version of the console² Add-on which makes it easier to captyure log output relevant to Add-on Developers. Note that you can rightclick > select > all > copy the entire log output as TEXT FORMAT (please no screenshots, logs should be text only). My Add-ons all have a debug switch which provides more context in the log should any errors occur; it's highly recommended to activate it before you capture a log. Also clear the log before creating the erratic behavior and disable content logging to avoid unnecessary spamming of the error console. The browser console (in Tools > Developer Tools > Developer Toolbox) can also be used but it's more complex & much harder to create a log file from this.
Created an attachment (id=8482) [details] Jaswami log file for Smart Template--24 May 2018
Thanks I tried resurrecting my old VM Ubuntu installation but I couldn't install the latest Thunderbird version. I probably need to download a complete new Ubuntu installer and generate a fresh VM to really test this. If you can, start Browser Toolbox and debug the code setting a breakpoint at smartTemplate-main.js line 561 (after insertTemplate) .. then single step and see if you get as far as line 575 or whether something unforeseen happens. this is the line where the "focus element" is determined. I can add some debugger statements to another test version to make it easier.
Created an attachment (id=8483) [details] jaswami SmartTemplate -- Toolbox log Thank you, Axel. I'm in unfamiliar territory with this. I didn't see "Browser Toolbox," but I saw "Developer Toolbox," so I've tried that and I attach a log from it. I think I must have done a sloppy job, but I hope it may be helpful. I'll have to go out soon and won't have much scope for doing more tonight. Tomorrow I should have time again. I don't at all want to offload work onto you, but one thought about Ubuntu 18.04, meanwhile, is that if you run it from a pen drive it will have the latest TB included. Thank you again.