wotzebra / livewire-sortablejs

A Laravel Livewire plugin that makes it easy to use Sortable.js
MIT License
289 stars 25 forks source link

on "updateTaskOrder" i get flat array #21

Open ithuis opened 1 year ago

ithuis commented 1 year ago

i have a tree structure with 8 root element, they al have children en so on.

ui works fine!

But when i drag and drop if get an array of 2000 root element, some have "items" . Shouln't it be the same 8 root elements?

ithuis commented 1 year ago

is dont understand why you want the array as a result. I now use this as a response

` onSort: (e) => {

        var itemId        = e.item.id;
        var fromParentId  = e.from.id;
        var toParentId    = e.to.id;
        var oldIndex      = e.oldIndex;
        var newIndex      = e.newIndex;

        component.call(masterEl.getAttribute('wire:sortable-group'),itemId, oldIndex, newIndex, fromParentId, toParentId);
    },`
gdebrauwer commented 1 year ago

Do you mean you have more than 2 levels deep of sortable lists? Because that is indeed not supported at the moment.