Skip to content
This repository was archived by the owner on Mar 10, 2024. It is now read-only.
This repository was archived by the owner on Mar 10, 2024. It is now read-only.

using track by in ng-repeat will cause dnd-moved not to trigger #500

@Mr-Skribbls

Description

@Mr-Skribbls

I made the mistake of using track by $index in ng-repeat. Like this:
<script type="text/ng-template" id="list.html">
<ul dnd-list="list">
<li ng-repeat="item in list track by $index"
dnd-draggable="item"
dnd-effect-allowed="move"
dnd-moved="list.splice($index, 1)"
dnd-selected="models.selected = item"
ng-class="{selected: models.selected === item}"
ng-include="item.type + '.html'">
</li>
</ul>
</script>
this causes dnd-moved to not trigger when you drag a bottom item up the list. Causing there to be duplicates.
I reproduced this using the demo code.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions