EventForDotNet.ts - DataTransfer event object is not parsed #18839
Labels
area-blazor
Includes: Blazor, Razor Components
✔️ Resolution: Duplicate
Resolved as a duplicate of another issue
Status: Resolved
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,
};
}
The text was updated successfully, but these errors were encountered: