Skip to content

EventForDotNet.ts - DataTransfer event object is not parsed #18839

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
Ellested opened this issue Feb 5, 2020 · 4 comments
Closed

EventForDotNet.ts - DataTransfer event object is not parsed #18839

Ellested opened this issue Feb 5, 2020 · 4 comments
Labels
area-blazor Includes: Blazor, Razor Components ✔️ Resolution: Duplicate Resolved as a duplicate of another issue Status: Resolved

Comments

@Ellested
Copy link

Ellested commented Feb 5, 2020

The DataTransfer field is always null and data is never passed to the .net code.
I assume that the dataTransfer property has to be a clone of the DOM event, in order for the data to be passed to Blazor. It's actually also necessary to return the dataTransfer object, if you want .net code to modify the dropEffect and effectAllowed. I'm not sure whether Blazor JSInterop supports modifcation off the event and pass it back to JS - but it would be nice :-)

function parseDragEvent(event: any) {
return {
...parseMouseEvent(event),
dataTransfer: event.dataTransfer,
};
}

@mkArtakMSFT mkArtakMSFT added the area-blazor Includes: Blazor, Razor Components label Feb 6, 2020
@javiercn
Copy link
Member

javiercn commented Feb 6, 2020

@Ellested thanks for contacting us.

We likely don't have support for this as it would involve marshalling the list of files automatically and that's not something we are likely to support out of the box due to the complexity of the requirements.

A better approach for this is to build whatever logic you need for your control in JS and use JS interop to talk to the .NET side

@mkArtakMSFT
Copy link
Contributor

This looks like a dupe of #17552

@mkArtakMSFT mkArtakMSFT added the ✔️ Resolution: Duplicate Resolved as a duplicate of another issue label Feb 6, 2020
@ghost ghost added the Status: Resolved label Feb 6, 2020
@Ellested
Copy link
Author

Ellested commented Feb 7, 2020

Yes, I already took the JS approach. I still believe it would be a good idea to send the full details, but maybe throttle the dragover event. It is actually fairly measurable on the CPU, when this event is handled today (without the full payload), so it's not a perfect solution either. But, it's a luxury problem :-)

@mkArtakMSFT
Copy link
Contributor

...but maybe throttle the dragover event

@Ellested, we plan to handle that as part of #10522

@ghost ghost locked as resolved and limited conversation to collaborators Mar 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-blazor Includes: Blazor, Razor Components ✔️ Resolution: Duplicate Resolved as a duplicate of another issue Status: Resolved
Projects
None yet
Development

No branches or pull requests

3 participants