Postlagerkarte / blazor-dragdrop

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

Dropzone is not compatible with TupleValue #130

Open JirkaVrbka opened 3 years ago

JirkaVrbka commented 3 years ago

Hello,

Currently, when a List of Tulpe values are given as Items the drag hrml components always have a 'plk-dd-inprogess' class no matter what

Code examle: `<Dropzone Items="@(new List<ValueTuple<string, string>>{new ("a", "b"), new ("c", "d"), new ("e","f")})">

@context.ToString()
</Dropzone>`

the HTML result for this is always

<div draggable="true" class="plk-dd-draggable plk-dd-inprogess "><div>(a, b)</div> </div>

which (by default) disables pointer events.

ViRuSTriNiTy commented 3 years ago

Did you try to pass an actual list instance to Items instead of creating a list inline with new? My assumption is that the Blazor diffing is not working here as on each lifecycle run the pointer of hte list differs hence the internal service for handling the drag and drop state gets confused.

JirkaVrbka commented 3 years ago

Yes, I tried that but the result is the same as before (and Dropzone works ok with inline new when the list is of different type like Tuple or string)