Hello,
I manage an array to display a list that contains a form with identical groups of fields. I have an ADD button to add a new group of fields. No problem to save the items in the database. The problem is related to the drag and drop.
I'm using livewire-sortable to sort the items. When I open the form, there are two cases :
Case 1 - the list has already some items and it displays the list of the existing items
Case 2 - the list is empty and I have to click on the ADD button to add the first group of fields
Case 1 : I have no problem to drag and drop via the handle, I can add some new groups of fields and there is once again no problem to drag and drop.
Case 2 : all the added groups of fields have a strange behavior when I attempt to drag and drop them => it's possible de drag the items from anywhere on the item whereas I have a handle and when I drop the item, it can be dropped anywhere.
It looks like a problem I had when I had forgotten to add a key to the livewire component. But here it's perhaps the same behavior, but not the same problem because it works fine with an existing list. So I think about perhaps the initialization of the script when the list is empty.
Do you have any idea about the origin of this problem ?
Thanks a lot.
Vincent