Bug 1578450 - Prevent opening attachments when sending an email with Ctrl+Enter. r=mkmelin
authorAlessandro Castellani <alessandro@thunderbird.net>
Wed, 02 Oct 2019 11:51:17 -0700
changeset 37056 73754cd20bd83544ef9eae5348e62784cede69b0
parent 37055 40eba987b24dfb84baf0d1ee0000b1764c818174
child 37057 3d6b66cfd6a5ebc38d473aa692caa5db3778bc55
push id395
push userclokep@gmail.com
push dateMon, 02 Dec 2019 19:38:57 +0000
reviewersmkmelin
bugs1578450
Bug 1578450 - Prevent opening attachments when sending an email with Ctrl+Enter. r=mkmelin
mail/base/content/mailWidgets.js
--- a/mail/base/content/mailWidgets.js
+++ b/mail/base/content/mailWidgets.js
@@ -1271,17 +1271,17 @@
 
       this.addEventListener("keypress", event => {
         // The spacebar should work just like the arrow keys, except that the
         // focused element doesn't change, so use moveByOffset here.
         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) {
+          if (this.currentItem && !event.ctrlKey && !event.shiftKey) {
             this.addItemToSelection(this.currentItem);
             let evt = document.createEvent("XULCommandEvent");
             evt.initCommandEvent(
               "command",
               true,
               true,
               window,
               0,