@@ -21,6 +21,7 @@ to start their own drag. Notably the `Deferral` can be used to execute any async
21
21
drag logic and call back into the WebView at a later time. The ` Handled `
22
22
property lets the WebView2 know whether to exercise its own drag logic or not.
23
23
24
+ ## Override drag and drop
24
25
``` C++
25
26
// Using DragStarting to simply make a synchronous DoDragDrop call instead of
26
27
// having WebView2 do it.
@@ -67,7 +68,10 @@ CHECK_FAILURE(m_compController5->add_DragStarting(
67
68
})
68
69
.Get(),
69
70
&m_dragStartingToken));
71
+ ```
70
72
73
+ ## Disable drag and drop
74
+ ```C++
71
75
// Using DragStarting to no-op a drag operation.
72
76
CHECK_FAILURE(m_compController5->add_DragStarting(
73
77
Callback<ICoreWebView2DragStartingEventHandler>(
@@ -76,7 +80,7 @@ CHECK_FAILURE(m_compController5->add_DragStarting(
76
80
{
77
81
// If the event is marked handled, WebView2 will not execute its
78
82
// drag logic.
79
- args->put_Handled(m_dragOverrideMode == DragOverrideMode::NOOP );
83
+ args->put_Handled(TRUE );
80
84
return S_OK;
81
85
})
82
86
.Get(),
@@ -125,7 +129,7 @@ interface ICoreWebView2DragStartingEventArgs : IUnknown {
125
129
/// Indicates whether this event has been handled by the app. If the
126
130
/// app handles this event, WebView2 will not initiate drag drop. If
127
131
/// the app does not handle the event, WebView2 will initiate its own
128
- /// drag drop logic.
132
+ /// drag drop logic. The default value is FALSE.
129
133
[ propput] HRESULT Handled([ in] BOOL value);
130
134
131
135
0 commit comments