Chrome: Emails removal issue from Outlook after drag and drop

|
| By Webner

Emails removal issue from Outlook after drag and drop operation in Chrome

The latest versions of Microsoft Edge and Chrome incorporates the ability to drag and drop an email directly from Outlook into the browser without the need of any third-party plugins like Outlook2Web. The feature to copy a received email from Outlook to a web application by performing drag and drop operation with the help of JS events such as ondrop, ondragenter, ondragleave, ondragover works fine. But there is an emails removal issue in Chrome(Chromium browsers) where the emails get deleted automatically when a drag-drop operation is performed on emails from Outlook to the web application in Chrome.
emails removal

The emails get deleted from Outlook due to the dropEffect being set as ‘move’ but as per the drop effect, the emails are getting moved from Outlook to the web application. But if we change the drop effect property from ‘move’ to ‘copy’, then the drag-drop operation drops a copy of Outlook email in web application in Chrome.

The potential code example to resolve the issue is written below:-

<div  id="dragdropdiv"
         ondrop="onDrop(event)"
         ondragleave="onDragLeave(event)"
         ondragover="onDragOver(event)" ondragenter="onDragEnter(event)">
</div>
function onDragOver(ev) {
    ev.preventDefault();
    ev.dataTransfer.dropEffect = "copy";
 }

With these changes being done everything will work fine in Chrome related browsers.

Leave a Reply

Your email address will not be published. Required fields are marked *