dotnet/aspnetcore

Setting and clearing data for DragDrop operations

dlr1 opened this issue · 5 comments

Just to clarify the request, what is needed here is to have support for:

  1. Have non-BlazorComponent elements (i.e the dragged component) at the C# side when the event is fired
  2. Be able to pass that element reference down to JS (today it is possible since 0.3.0 to pass a BlazorComponent reference down to JS, need to pass those new element references instead)
  3. 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

sven5 commented

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.

https://github.com/Lupusa87/BlazorDragAndDrop

https://lupblazordraganddrop.z20.web.core.windows.net/

oiBio commented

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.