solid-dnd icon indicating copy to clipboard operation
solid-dnd copied to clipboard

SortableProvider doesn't like "0" as an ID

Open benbriedis opened this issue 1 year ago • 3 comments

I have an example here: https://stackblitz.com/edit/solidjs-templates-uekvqb If you drag around the row with the '0' ID then a gap is not made for it in the list. You can drop the item OK.

benbriedis avatar Jul 22 '24 04:07 benbriedis

Thanks for the report and reproduction. I'll take a look.

martinpengellyphillips avatar Jul 23 '24 22:07 martinpengellyphillips

From a quick look I imagine it is caused by this naive check here: https://github.com/thisbeyond/solid-dnd/blob/809014fa9ea058ab3cf54ad9d855970b7fd866ab/src/sortable-context.tsx#L44

I'll fix that to be stricter (and avoid treating a 0 as a false evaluation).

martinpengellyphillips avatar Jul 23 '24 22:07 martinpengellyphillips

From a quick look I imagine it is caused by this naive check here:

https://github.com/thisbeyond/solid-dnd/blob/809014fa9ea058ab3cf54ad9d855970b7fd866ab/src/sortable-context.tsx#L44

I'll fix that to be stricter (and avoid treating a 0 as a false evaluation).

Yes this fix works.

floratmin avatar Oct 28 '24 13:10 floratmin