dotnet / aspnetcore

ASP.NET Core is a cross-platform .NET framework for building modern cloud-based web applications on Windows, Mac, or Linux.
https://asp.net
MIT License
35.44k stars 10.02k forks source link

DataTransfer in DragEventArgs always empty #43976

Open puschie286 opened 2 years ago

puschie286 commented 2 years ago

Is there an existing issue for this?

Describe the bug

When you use the blazor version of ondrop ( @ondrop ) you get an DragEventArgs parameter. This DragEventArgs has an DataTransfer property ( like the js version ). But this DataTransfer is always empty.

Expected Behavior

You should get the populated DataTransfer.

Steps To Reproduce

  1. define the draggable attribute on an element
  2. define ondragstart ( js-version ) ( on the same element as 1. ) and set data to the dataTransfer property of the event parameter
  3. define ondrop ( blazor-version ) and just output DataTransfer property of the DragEventArgs parameter
  4. drag element from 1. onto the element of 3. ( 5. See your output that show an empty DataTransfer )

Exceptions (if any)

No response

.NET Version

6.0.108

Anything else?

No response

ghost commented 2 years ago

We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process.

TanayParikh commented 2 years ago

Hey @puschie286, thanks for contacting us. This can be achieved via a custom event handler.

Rough guidance for how to do this, for clipboard event args (instead of drag event args), is available here

LuohuaRain commented 1 year ago

Yeah, I think maybe DataTransfer should have GetData() and SetData so as js do?

ghost commented 11 months ago

We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process.