Closed rondog closed 7 years ago
anyone??
Can you provide a plunkr or codepen demonstrating this behaviour?
In the simple lists example it works as exspected and doesnt delete the item if you drop it outside the lists.
The code used there to remove the item from the array is dnd-moved="list.splice($index, 1)"
, did you use dnd-dragend="list.splice($index, 1)"
by accident? The dragend-callback is triggered wether or not you moved or moved it, it's also called when you drop the item outside any list.
That would cause the behaviour you described I think (haven't tested it).
@fberthel I indeed used dnd-dragend
. I ended up using that because my ng-repeat
with an order by
was creating weird duplicate entries. I have since changed the way my ordering works and am not using order by
anymore but never changed back to dnd-moved
Thanks for solving this.
Had the same issues with order by
, somewhere in the docs it states that you shouldn't use order by
and also avoid using track by $index
as this causes similar weird behaviour.
You're welcome :)
I should read the docs more carefully :)
I must be overlooking this option as I can't imagine this isn't something you can already do. When I drag an item out of the list the item gets deleted from the array. I need to disable that. Is that something I do in one of the callbacks? I cannot find this option.