Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » DropTarget default operation for drag from Outlook(When dragging an item from Outlook onto DropTarget in Chrome/Edge this item will be delete from Outlook)
DropTarget default operation for drag from Outlook [message #1838502] Fri, 26 February 2021 15:50
Gunnar Adams is currently offline Gunnar AdamsFriend
Messages: 49
Registered: May 2016
Member
Hi,
with newer releases of Chromium based browsers (Chrome / Edge), it has become possible to drag mails from Outlook directly onto a DropTarget in the browser.

It seems that RAP (3.15) will default to the move operation. Key-modifiers such as Shift do not work to change the operation.

As the fix seems to be relatively simple (described here:
https://blog.webnersolutions.com/chrome-emails-removal-issue-from-outlook-after-drag-and-drop/ ), I would like to know, if you plan to implement this in a future version.

For now, I explicitely set both the event.data.Transfer.dropEffect and the operation to "copy". This seems to resolve the issue, although it could be enhanced by handling modifier keys and checking the DND.DROP_MOVE and DND.DROP_COPY options set on the widget.

My changes in widgets/DropTarget.js:

_onDragEvent : function( event ) {
      try {
        if( this._isDraggingFiles( event ) ) {
          // NOTE: Feedback effects are currenlty only respected by webkit, will ignore for now
          rwt.event.EventHandlerUtil.stopDomEvent( event );
          event.stopPropagation();
          if( event.type === "drop" ) {          	
            this._sendDropAccept( event );
          } else if (event.type === "dragover" ) {
          	event.dataTransfer.dropEffect = "copy";
          }
        }
      } catch( ex ) {
        rwt.runtime.ErrorHandler.processJavaScriptError( ex );
      }
    },

    _sendDropAccept : function( event ) {
      var remoteObject = rwt.remote.Connection.getInstance().getRemoteObject( this );
      remoteObject.notify( "DropAccept", {
        "x" : Math.round( event.pageX ),
        "y" : Math.round( event.pageY ),
        "time" : rwt.remote.EventUtil.eventTimestamp(),
        "operation" : "copy",
        "feedback" : 0,
        "files" : this._getFiles( event )
      } );
    },


Best regards,
Gunnar
Previous Topic:Eclipse RAP application in horizontally scaled Azure WebApp Container
Next Topic:KEY DOWN and KEYUP events are firing rapidly in RAP within Browser.
Goto Forum:
  


Current Time: Tue Apr 23 14:02:00 GMT 2024

Powered by FUDForum. Page generated in 0.02993 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top