Bug: Dragging an item back to it's original place does not update the ng-repeat comments in the view #82
Description
This results in a mismatch between the model and the view and leads to terrible things.
Test case:
http://plnkr.co/edit/uxwalNYGtgaJCrbJbJOJ?p=preview
Reproduction steps:
- Drag item "one" in place of item "two" and then back to it's original place (without releasing)
- Click the X button on item "one"
Result:
All items except "two" disappear, instead of just removing item "one".
Reason:
Something to do with the ng-repeat comments not updating in this situation.
I tried to hack a solution by making the model splice
the changes on the change
callback. Tracking the change index using ui.item.placeholder.index()
, and it worked fine while dragging (showing real-time model updates while dragging), but ran into problems once I released the item.
Besides fixing the bug, I think it's logical to expect real-time updates of the model as the changes are being made while dragging.