Skip to content

Setting and clearing data for DragDrop operations #5532

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
dlr1 opened this issue Jun 8, 2018 · 5 comments
Closed

Setting and clearing data for DragDrop operations #5532

dlr1 opened this issue Jun 8, 2018 · 5 comments
Labels
area-blazor Includes: Blazor, Razor Components

Comments

@dlr1
Copy link

dlr1 commented Jun 8, 2018

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)

@galvesribeiro
Copy link
Member

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
Copy link

sven5 commented Oct 17, 2018

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

@aspnet-hello aspnet-hello transferred this issue from dotnet/blazor Dec 17, 2018
@aspnet-hello aspnet-hello added area-mvc Includes: MVC, Actions and Controllers, Localization, CORS, most templates area-blazor Includes: Blazor, Razor Components labels Dec 17, 2018
@Lupusa87
Copy link
Contributor

Lupusa87 commented Mar 5, 2019

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
Copy link

oiBio commented Apr 9, 2019

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?

@danroth27
Copy link
Member

We don't have any plans to provide anything specific here. You should be able to enable drag & drop scenarios via jsinterop. Closing.

@mkArtakMSFT mkArtakMSFT removed area-mvc Includes: MVC, Actions and Controllers, Localization, CORS, most templates labels May 9, 2019
@ghost ghost locked as resolved and limited conversation to collaborators Dec 3, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-blazor Includes: Blazor, Razor Components
Projects
None yet
Development

No branches or pull requests

8 participants