I know Blazor is a new technology. Its current release states v0.5.1
However I'm currently implementing a PoC for a new web application. We'd like to have the feature drag&drop in the app. I tried to implement it the Blazor way but it does not work.
My droptarget:
<div class="col" ondragstart="@AllowDragOver" ondrop="@Add">
And the draggable item:
<span class="badge badge-warning" draggable="true">îtem 1</span>
The Blazor C# code:
@functions {
void Add()
{
Items.Add("hello");
}
void AllowDragOver(UIDragEventArgs e)
{
}
}
The problem is that the drop target does not show in the browser as a drop target:
What I've read so far is that when attaching an event handler to a Blazor C# function (e.g. ondragstart) than the default behavior is the well-known "e.preventDefault()" which should make the drop target droppable.
Does anyone know how to fix this?
Sven
