Closed Bug 1578450 Opened 5 years ago Closed 5 years ago

with focus on attachment pane, Ctrl+Enter both tried to open the attachment and sends

Categories

(Thunderbird :: Message Compose Window, defect, P2)

Tracking

(thunderbird_esr6870+ fixed, thunderbird70 fixed, thunderbird71 fixed)

VERIFIED FIXED
Thunderbird 71.0
Tracking Status
thunderbird_esr68 70+ fixed
thunderbird70 --- fixed
thunderbird71 --- fixed

People

(Reporter: jara.babak, Assigned: aleca)

References

Details

(Keywords: regression)

Attachments

(1 file, 1 obsolete file)

User Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:68.0) Gecko/20100101 Firefox/68.0

Steps to reproduce:

I did following:

  1. typed an email
  2. inserted an attachment using drag and drop
  3. pressed [Ctrl+Enter] to send it

Actual results:

  • thunderbird tried to open the attachment
  • at the same time it started sending the email

Expected results:

It should ONLY send the email, as always before.

OK, if you're in the attachment pane, Ctrl+Enter or Ctrl+Shift+Enter sends and opens the attachment. If the attachment pane doesn't have focus, it works as before.

Alex, you wanted a regression, here it is. I don't think it's worth letting Alice find out where this changed, it's related to the de-XBL of that attachment list.

Severity: normal → minor
Status: UNCONFIRMED → NEW
Ever confirmed: true
Flags: needinfo?(alessandro)
Keywords: regression
Component: Mail Window Front End → Message Compose Window
Assignee: nobody → alessandro
Flags: needinfo?(alessandro)
Priority: -- → P2
Blocks: tb68found
Summary: Sending email by Ctrl+Enter → with focus on attachment pane, Ctrl+Enter both tried to open the attachment and sends
Status: NEW → ASSIGNED
Attached patch 1578450-attachment-email.patch (obsolete) — Splinter Review

This tiny change fixes the issue, but I'm not sure is the proper solution.

I've implemented an extra condition to check if the list has the ID "attachmentBucket" which is the ID assigned to the attachment list used in the compose dialog.

With this conditions, attachments can't be downloaded with CTRL+ENTER or CTRL+SHIFT+ENTER at all, which is the same behaviour we had in TB60.
Is this correct UX wise?
Are we safe to assume that no user will need to download its own attachments while composing a new message?

Attachment #9097745 - Flags: review?(mkmelin+mozilla)

When you want to download/open attachment while composing a new message, you can naturally use DOUBLECLICK or ENTER when it is focused.
So YES, you are save to assume that no user will need to download its own attachments while composing a new message with CTRL+ENTER or CTRL+SHIFT+ENTER.

Comment on attachment 9097745 [details] [diff] [review]
1578450-attachment-email.patch

Review of attachment 9097745 [details] [diff] [review]:
-----------------------------------------------------------------

::: mail/base/content/mailWidgets.js
@@ +1275,5 @@
>          if (event.keyCode == KeyEvent.DOM_VK_SPACE) {
>            this.moveByOffset(0, !event.ctrlKey, event.shiftKey);
>            event.preventDefault();
>          } else if (event.keyCode == KeyEvent.DOM_VK_RETURN) {
> +          if (this.currentItem && this.id != "attachmentBucket") {

we shouldn't be checking for ids. 

I think what is missing is an event.stopPropagation() or event.preventDefault()

I also don't understand why a new event is needed. Can't we just dispatch the original event?
Attachment #9097745 - Flags: review?(mkmelin+mozilla) → review-

I think what is missing is an event.stopPropagation() or event.preventDefault()

We can't as those methods will stop the event that sends the email.

I also don't understand why a new event is needed. Can't we just dispatch the original event?

We're not triggering any new event, the problem is that 2 events are getting triggered at once.

  • Hitting ENTER on an attachment item in the compose window triggers the download.
  • Hitting CTRL+ENTER or CTRL+SHIFT+ENTER in the compose window, also triggers the download of the attachment if one item has focus, instead it should only submit the message.

I think I found the solution by checking if the CTRL or SHIFT modifier keys are pressed.

Attachment #9097745 - Attachment is obsolete: true
Attachment #9098352 - Flags: review?(mkmelin+mozilla)
Comment on attachment 9098352 [details] [diff] [review]
1578450-attachment-email.patch

Review of attachment 9098352 [details] [diff] [review]:
-----------------------------------------------------------------

Thx! r=mkmelin
Attachment #9098352 - Flags: review?(mkmelin+mozilla) → review+
Attachment #9098352 - Flags: approval-comm-esr68+
Attachment #9098352 - Flags: approval-comm-beta+

I launched a try-run just to be sure I'm not messing up anything for the attachment panel: https://treeherder.mozilla.org/#/jobs?repo=try-comm-central&revision=d222d91c69e180d8db61ffb4b6456cff0b86641c

Pushed by mozilla@jorgk.com:
https://hg.mozilla.org/comm-central/rev/73754cd20bd8
Prevent opening attachments when sending an email with Ctrl+Enter. r=mkmelin

Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
Target Milestone: --- → Thunderbird 71.0

Works well in TB 70 beta 3 (I hadn't tried it before).

Status: RESOLVED → VERIFIED

Yay! :D

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: