DropTarget default operation for drag from Outlook [message #1838502] |
Fri, 26 February 2021 15:50 |
Gunnar Adams 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
|
|
|
Powered by
FUDForum. Page generated in 0.03101 seconds