Skip to content
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

DataTransfer in DragEventArgs always empty #43976

Open
1 task done
puschie286 opened this issue Sep 14, 2022 · 4 comments
Open
1 task done

DataTransfer in DragEventArgs always empty #43976

puschie286 opened this issue Sep 14, 2022 · 4 comments
Labels
area-blazor Includes: Blazor, Razor Components enhancement This issue represents an ask for new feature or an enhancement to an existing one
Milestone

Comments

@puschie286
Copy link

puschie286 commented Sep 14, 2022

Is there an existing issue for this?

  • I have searched the existing issues

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

@mkArtakMSFT mkArtakMSFT added area-blazor Includes: Blazor, Razor Components enhancement This issue represents an ask for new feature or an enhancement to an existing one labels Sep 14, 2022
@mkArtakMSFT mkArtakMSFT added this to the Backlog milestone Sep 14, 2022
@ghost
Copy link

ghost commented Sep 14, 2022

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

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

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

@mkArtakMSFT mkArtakMSFT modified the milestones: Backlog, BlazorPlanning Nov 5, 2023
@mkArtakMSFT mkArtakMSFT modified the milestones: Planning: WebUI, Backlog Dec 4, 2023
@ghost
Copy link

ghost commented Dec 4, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-blazor Includes: Blazor, Razor Components enhancement This issue represents an ask for new feature or an enhancement to an existing one
Projects
None yet
Development

No branches or pull requests

6 participants
@puschie286 @TanayParikh @mkArtakMSFT @LuohuaRain and others