{"action":"created","issue":{"url":"https://api.github.com/repos/mikeric/rivets/issues/515","labels_url":"https://api.github.com/repos/mikeric/rivets/issues/515/labels{/name}","comments_url":"https://api.github.com/repos/mikeric/rivets/issues/515/comments","events_url":"https://api.github.com/repos/mikeric/rivets/issues/515/events","html_url":"https://github.com/mikeric/rivets/issues/515","id":102397010,"number":515,"title":"rv-each removes the wrong component when I splice the model.","user":{"login":"saiphcbk","id":8588986,"avatar_url":"https://avatars.githubusercontent.com/u/8588986?v=3","gravatar_id":"","url":"https://api.github.com/users/saiphcbk","html_url":"https://github.com/saiphcbk","followers_url":"https://api.github.com/users/saiphcbk/followers","following_url":"https://api.github.com/users/saiphcbk/following{/other_user}","gists_url":"https://api.github.com/users/saiphcbk/gists{/gist_id}","starred_url":"https://api.github.com/users/saiphcbk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/saiphcbk/subscriptions","organizations_url":"https://api.github.com/users/saiphcbk/orgs","repos_url":"https://api.github.com/users/saiphcbk/repos","events_url":"https://api.github.com/users/saiphcbk/events{/privacy}","received_events_url":"https://api.github.com/users/saiphcbk/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":17,"created_at":"2015-08-21T14:53:33Z","updated_at":"2016-01-06T04:10:05Z","closed_at":null,"body":"Hi, I've been enjoying using rivets but have hit upon a problem I can't seem to get around. \r\n\r\nI've started using components in an rv-each block. It all renders fine when it loads but when I try to remove the first element in the model's array using splice it appears that the wrong component is removed. When I check the model it correctly shows the first element removed. \r\n\r\nI've created a fiddle to try and be more clear \r\nhttp://jsfiddle.net/dko9b9k4/\r\n\r\n```javascript\r\nvar model2 = [{ \"value\":\"1\"},{\"value\":\"2\"},{\"value\":\"3\"}];\r\n\r\nwindow.onload = function () \r\n{\r\n    function controlviewmodel(attributes) {\r\n        this.data = attributes;\r\n    }\r\n\r\n    rivets.components['control'] = {\r\n        template: function() {\r\n            return '<button>{data.option.value}</button>';\r\n        },\r\n        initialize: function(el, attributes) {\r\n            return new controlviewmodel(attributes);\r\n        }\r\n    };\r\n\r\n    rivets.bind(document.querySelector('#view'), {model:model2});\r\n\r\n}\r\n\r\nfunction doSplice()\r\n{\r\n\tmodel2.splice(0,1);\r\n}\r\n```\r\n\r\n\r\n`<button onClick=\"doSplice()\">Splice</button>`\r\n\r\n`<table id=\"view\">`\r\n    `<tr rv-each-option=\"model\">`\r\n        `<td>`\r\n            `<control option=\"option\"/>`\r\n        `</td>`\r\n       ` <td>{option.value}</td>`\r\n    `</tr>`\r\n`</table>`"},"comment":{"url":"https://api.github.com/repos/mikeric/rivets/issues/comments/169215501","html_url":"https://github.com/mikeric/rivets/issues/515#issuecomment-169215501","issue_url":"https://api.github.com/repos/mikeric/rivets/issues/515","id":169215501,"user":{"login":"naturalist","id":606236,"avatar_url":"https://avatars.githubusercontent.com/u/606236?v=3","gravatar_id":"","url":"https://api.github.com/users/naturalist","html_url":"https://github.com/naturalist","followers_url":"https://api.github.com/users/naturalist/followers","following_url":"https://api.github.com/users/naturalist/following{/other_user}","gists_url":"https://api.github.com/users/naturalist/gists{/gist_id}","starred_url":"https://api.github.com/users/naturalist/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/naturalist/subscriptions","organizations_url":"https://api.github.com/users/naturalist/orgs","repos_url":"https://api.github.com/users/naturalist/repos","events_url":"https://api.github.com/users/naturalist/events{/privacy}","received_events_url":"https://api.github.com/users/naturalist/received_events","type":"User","site_admin":false},"created_at":"2016-01-06T04:10:05Z","updated_at":"2016-01-06T04:10:05Z","body":"@Duder-onomy Thanks for the reply! I suspected that what I'm observing is expected behavior rather than a bug. It would save many hours of debugging for someone if it was explained in the docs.\r\nTypeScript is a superset of JavaScript, so I solved my own problem to simply writing the instance, instead of relying on TS's `class` keyword. Though, I've lost TS's strict type checks and such .. No big deal.\r\n\r\nI'd be interested to see how you solved this problem using `rv-track-by`. There is no rush ... It would suffice if you sent me a gist."}}