Bug 1267804 - Use preventDefault() after address drop. r=aceman a=rkent
authorJorg K
Sat, 30 Apr 2016 13:26:27 +0200
changeset 27032 da197f5021a195fada66515f85089450c3afa0de
parent 27031 5ea3c40618e745569d734b68ab7cebbe3d01f1ce
child 27033 93e4725bc203d8a1fdc5887f6575fa42e6d48b14
push id1850
push userclokep@gmail.com
push dateWed, 08 Mar 2017 19:29:12 +0000
treeherdercomm-esr52@028df196b2d9 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersaceman, rkent
bugs1267804
Bug 1267804 - Use preventDefault() after address drop. r=aceman a=rkent
mail/components/compose/content/MsgComposeCommands.js
--- a/mail/components/compose/content/MsgComposeCommands.js
+++ b/mail/components/compose/content/MsgComposeCommands.js
@@ -4469,18 +4469,26 @@ var envelopeDragObserver = {
               attachment.size = size;
 
             attachments.push(attachment);
           }
         }
         else if (item.flavour.contentType == "text/x-moz-address")
         {
           // process the address
-          if (rawData)
+          if (rawData) {
             DropRecipient(aEvent.target, rawData);
+
+            // Since we are now using ondrop (eDrop) instead of previously using
+            // ondragdrop (eLegacyDragDrop), we must prevent the default
+            // which is dropping the address text into the widget.
+            // Note that stopPropagation() is called by our caller in
+            // nsDragAndDrop.js.
+            aEvent.preventDefault();
+          }
         }
       }
 
       if (attachments.length)
         AddAttachments(attachments);
     },
 
   onDragOver: function (aEvent, aFlavour, aDragSession)