Skip to content

Commit 8013d2f

Browse files
committed
Fixed dropping Link effect
1 parent 1be3f82 commit 8013d2f

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

CefSharp.Example/Resources/DragDropCursorsTest.html

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,18 @@
2727
}
2828

2929
function drag(ev) {
30-
ev.dataTransfer.setData("text", ev.target.id);
30+
ev.dataTransfer.effectAllowed = "all";
31+
ev.dataTransfer.setData("text/plain", ev.target.id);
3132
}
3233

3334
function drop(ev) {
3435
ev.preventDefault();
35-
var data = ev.dataTransfer.getData("text");
36-
ev.target.appendChild(document.getElementById(data));
36+
var data = ev.dataTransfer.getData("text/plain");
37+
var element = document.getElementById(data);
38+
if (element) {
39+
ev.target.appendChild(element);
40+
}
41+
alert(ev.dataTransfer.dropEffect + " | " + data);
3742
}
3843
</script>
3944
</head>

CefSharp.Wpf/Internals/DragOperationMaskExtensions.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@ public static DragDropEffects GetDragEffects(this DragOperationsMask mask)
5050
{
5151
if ((mask & DragOperationsMask.Every) == DragOperationsMask.Every)
5252
{
53-
return DragDropEffects.All;
53+
// return all effects (!= DragDropEffects.All, which doesn't include Link)
54+
return DragDropEffects.Scroll | DragDropEffects.Copy | DragDropEffects.Move | DragDropEffects.Link;
5455
}
5556
if ((mask & DragOperationsMask.Copy) == DragOperationsMask.Copy)
5657
{

0 commit comments

Comments
 (0)