Setting and clearing data for DragDrop operations
dlr1 opened this issue · 5 comments
Can we get methods to SetData, ClearData on DataTransfer object for DragDrop?
https://developer.mozilla.org/en-US/docs/Web/API/DataTransfer
https://html.spec.whatwg.org/multipage/dnd.html#dom-datatransfer-setdata
https://developer.mozilla.org/en-US/docs/Web/API/DataTransfer/dropEffect
take a look at the example (scroll down)
Just to clarify the request, what is needed here is to have support for:
- Have non-
BlazorComponentelements (i.e the dragged component) at the C# side when the event is fired - Be able to pass that element reference down to JS (today it is possible since 0.3.0 to pass a
BlazorComponentreference down to JS, need to pass those new element references instead) - Be able to call C# non-static classes (or components/elements) from JS (i.e. when a callback is fired on JS, invoke a non-static/instance method on C# side)
That would allow me to implement those missing methods.
cc: @danroth27
Drag and drop currently works with Edge and Chrome, but not Firefox. For me, it seems that the missing SetData function is the root cause for this. Please see my post here
Please check this links to see how drag and drop works in blazor, including firefox.
Is this a bug on Firefox or Blazor/Razor-Components side?
Do we have to use the JSInterop workaround or is it planned to be fixed?
We don't have any plans to provide anything specific here. You should be able to enable drag & drop scenarios via jsinterop. Closing.