Postlagerkarte / blazor-dragdrop

Easy-to-use Drag and Drop Library for Blazor
MIT License
405 stars 96 forks source link

Dropzone, added DragEnd property to allow executing logic when a drag operation ends #97

Closed ViRuSTriNiTy closed 3 years ago

ViRuSTriNiTy commented 3 years ago

see #96

Postlagerkarte commented 3 years ago

Looks great! Thanks.

ViRuSTriNiTy commented 3 years ago

@Postlagerkarte Would you please release a new NuGet package? Otherwise I need to work with a git submodule and this is somewhat tedious.

k2tomasz commented 3 years ago

@ViRuSTriNiTy DragDropService is reset (DragDropService.ActiveItem = default) before DragEnd is called resulting in null being passed as parameter to DragEnd.

ViRuSTriNiTy commented 3 years ago

@tkrakowiak Can you provide a minimal reproducible example?

k2tomasz commented 3 years ago

@ViRuSTriNiTy you can change your ToDoList example like this:

<Dropzone Items="MyToDoList" DragEnd="DragEnd">
    <Todo OnRemoveClick="(item)=>MyToDoList.Remove(item)" Item="@context"></Todo>
</Dropzone>

private void DragEnd(TodoItem obj)
{
    var todo = obj;
}
k2tomasz commented 3 years ago

@ViRuSTriNiTy I think this PR would be enough to fix it.

https://github.com/Postlagerkarte/blazor-dragdrop/pull/119