Closed Bug 1732558 Opened 4 months ago Closed 3 months ago

browser.compose.beginReply starts a compose window with the cursor in the to field, even though it is filled already

Categories

(Thunderbird :: Add-Ons: Extensions API, defect)

defect

Tracking

(thunderbird_esr91+ fixed, thunderbird95+ fixed)

RESOLVED FIXED
96 Branch
Tracking Status
thunderbird_esr91 + fixed
thunderbird95 + fixed

People

(Reporter: standard8, Assigned: TbSync)

References

Details

(Keywords: regression)

Attachments

(1 file)

When using browser.compose.beginReply, the cursor gets put into the "to" field rather than into the body of the message.

If I use the normal Thunderbird functions on the same message then I don't have an issue.

I think this is probably timing related - the compose window calls AdjustFocus once the body is set up, so the "to" field possibly hasn't been set at that stage. I tried throwing in a couple of breakpoints which would "fix" the issue.

Requesting tracking for 91 as this is an issue in the WebExtension APIs that affects add-ons. I'm not sure if this was preset in 78 or not.

I think this probably is a regression, as I just had someone report it against 91.

Keywords: regression

hmm, is bug 1736421 another example? "Responding to an email should not focus the address field, but the text-area"

(In reply to Wayne Mery (:wsmwk) from comment #2)

hmm, is bug 1736421 another example? "Responding to an email should not focus the address field, but the text-area"

I can't see that add-on using these APIs (and also can't figure out how it to make it work...), however, if there's something here that is actually timing related, then it could in theory affect more than just add-ons.

Can you attach a reproducer add-on? Do I have to provide certain composeDetails?

This is not triggering it for me:

browser.messageDisplayAction.onClicked.addListener(async (tab) => {
    let message = await browser.messageDisplay.getDisplayedMessage(tab.id);
    let newTab = await browser.compose.beginReply(message.id);
})

Tested in 91.

(In reply to John Bieling (:TbSync) from comment #4)

Can you attach a reproducer add-on? Do I have to provide certain composeDetails?

Both

browser.messageDisplayAction.onClicked.addListener(async (tab) => {
    let message = await browser.messageDisplay.getDisplayedMessage(tab.id);
    let newTab = await browser.compose.beginReply(message.id, { identityId: "id2" });
})

and

browser.composeAction.onClicked.addListener(async (tab) => {
    await browser.compose.setComposeDetails(tab.id, { identityId: "id2" });
})

set the cursor into the "To"-field, tested in 94.0b4 as well as 91.2.1

Conversations also uses the identityId field, so maybe that is the cause.

Identity Chooser (https://addons.thunderbird.net/de/thunderbird/addon/identity-chooser/) is affected by this as well. Since Thunderbird auto-updated to 91.2 for users I start to get bug reports.

Duplicate of this bug: 1738593
Assignee: nobody → john
Status: NEW → ASSIGNED

Pushed by mkmelin@iki.fi:
https://hg.mozilla.org/comm-central/rev/54520a4b8fe4
Preserve focused element when calling messenger.compose.SetComposeDetails(). r=mkmelin

Status: ASSIGNED → RESOLVED
Closed: 3 months ago
Resolution: --- → FIXED
Target Milestone: --- → 96 Branch

Comment on attachment 9248857 [details]
Bug 1732558 - Preserve focused element when calling messenger.compose.SetComposeDetails(). r=mkmelin

[Approval Request Comment]
Regression caused by (bug #):
User impact if declined:
Annoyance: The cursor is placed in the TO field instead of the editor

Testing completed (on c-c, etc.):
Risk to taking this patch (and alternatives if risky):
Very Low.

Attachment #9248857 - Flags: approval-comm-beta?

Comment on attachment 9248857 [details]
Bug 1732558 - Preserve focused element when calling messenger.compose.SetComposeDetails(). r=mkmelin

[Triage Comment]
Approved for beta

Attachment #9248857 - Flags: approval-comm-beta? → approval-comm-beta+

Comment on attachment 9248857 [details]
Bug 1732558 - Preserve focused element when calling messenger.compose.SetComposeDetails(). r=mkmelin

[Approval Request Comment]
Regression caused by (bug #):
Annoyance: The cursor is placed in the TO field instead of the editor

Testing completed (on c-c, etc.):
Risk to taking this patch (and alternatives if risky):
Very Low.

Attachment #9248857 - Flags: approval-comm-esr91?

Comment on attachment 9248857 [details]
Bug 1732558 - Preserve focused element when calling messenger.compose.SetComposeDetails(). r=mkmelin

[Triage Comment]
Approved for esr91

Attachment #9248857 - Flags: approval-comm-esr91? → approval-comm-esr91+
You need to log in before you can comment on or make changes to this bug.