Skip to content

Commit f3fcaac

Browse files
committed
Merge pull request #1561 from cefsharp/fix/support-drag-drop-from-input-fields
Added support for drag & drop from input fields
2 parents 0c3427f + 50ed2b1 commit f3fcaac

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

CefSharp.Wpf/Internals/WpfExtensions.cs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,12 @@
22
//
33
// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
44

5+
using CefSharp.Internals;
6+
using System;
57
using System.IO;
68
using System.Text;
79
using System.Windows;
810
using System.Windows.Input;
9-
using CefSharp.Internals;
1011

1112
namespace CefSharp.Wpf.Internals
1213
{
@@ -115,7 +116,12 @@ public static CefDragDataWrapper GetDragDataWrapper(this DragEventArgs e)
115116
if (dragData.IsFragment)
116117
{
117118
dragData.FragmentText = (string)e.Data.GetData(DataFormats.Text);
118-
dragData.FragmentHtml = (string)e.Data.GetData(DataFormats.Html);
119+
120+
var htmlData = (string)e.Data.GetData(DataFormats.Html);
121+
if (htmlData != String.Empty)
122+
{
123+
dragData.FragmentHtml = htmlData;
124+
}
119125
}
120126

121127
return dragData;

0 commit comments

Comments
 (0)