{"action":"created","issue":{"url":"https://api.github.com/repos/a5hik/ng-sortable/issues/299","repository_url":"https://api.github.com/repos/a5hik/ng-sortable","labels_url":"https://api.github.com/repos/a5hik/ng-sortable/issues/299/labels{/name}","comments_url":"https://api.github.com/repos/a5hik/ng-sortable/issues/299/comments","events_url":"https://api.github.com/repos/a5hik/ng-sortable/issues/299/events","html_url":"https://github.com/a5hik/ng-sortable/issues/299","id":141614557,"number":299,"title":"Incorrect insertion when using track by","user":{"login":"beesden","id":5845634,"avatar_url":"https://avatars.githubusercontent.com/u/5845634?v=3","gravatar_id":"","url":"https://api.github.com/users/beesden","html_url":"https://github.com/beesden","followers_url":"https://api.github.com/users/beesden/followers","following_url":"https://api.github.com/users/beesden/following{/other_user}","gists_url":"https://api.github.com/users/beesden/gists{/gist_id}","starred_url":"https://api.github.com/users/beesden/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/beesden/subscriptions","organizations_url":"https://api.github.com/users/beesden/orgs","repos_url":"https://api.github.com/users/beesden/repos","events_url":"https://api.github.com/users/beesden/events{/privacy}","received_events_url":"https://api.github.com/users/beesden/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-03-17T15:21:07Z","updated_at":"2016-03-28T08:34:26Z","closed_at":null,"body":"If a ng-repeat list is using track by, when the list is sorted the wrong child is being copied (the original is still being removed) and so when that element is resorted it is removed as it already exists in the list.\r\n\r\n\r\n```\r\n<tbody data-as-sortable data-ng-model=\"myList\">\r\n    <tr data-ng-repeat=\"item in myList track by $index\" data-as-sortable-item>\r\n        <td data-as-sortable-item-handle data-icon=\"drag\"></td>\r\n        <td>{{ item.name }}</td>\r\n        <td>\r\n            <button type=\"button\" data-ng-click=\"doSomething( $index )\">Click me!</button>\r\n        </td>\r\n    </tr>\r\n</tbody>\r\n```"},"comment":{"url":"https://api.github.com/repos/a5hik/ng-sortable/issues/comments/202300238","html_url":"https://github.com/a5hik/ng-sortable/issues/299#issuecomment-202300238","issue_url":"https://api.github.com/repos/a5hik/ng-sortable/issues/299","id":202300238,"user":{"login":"vncnz","id":5114389,"avatar_url":"https://avatars.githubusercontent.com/u/5114389?v=3","gravatar_id":"","url":"https://api.github.com/users/vncnz","html_url":"https://github.com/vncnz","followers_url":"https://api.github.com/users/vncnz/followers","following_url":"https://api.github.com/users/vncnz/following{/other_user}","gists_url":"https://api.github.com/users/vncnz/gists{/gist_id}","starred_url":"https://api.github.com/users/vncnz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vncnz/subscriptions","organizations_url":"https://api.github.com/users/vncnz/orgs","repos_url":"https://api.github.com/users/vncnz/repos","events_url":"https://api.github.com/users/vncnz/events{/privacy}","received_events_url":"https://api.github.com/users/vncnz/received_events","type":"User","site_admin":false},"created_at":"2016-03-28T08:34:26Z","updated_at":"2016-03-28T08:34:26Z","body":"Same problem :-/"}}