{"action":"created","issue":{"url":"https://api.github.com/repos/RubaXa/Sortable/issues/224","labels_url":"https://api.github.com/repos/RubaXa/Sortable/issues/224/labels{/name}","comments_url":"https://api.github.com/repos/RubaXa/Sortable/issues/224/comments","events_url":"https://api.github.com/repos/RubaXa/Sortable/issues/224/events","html_url":"https://github.com/RubaXa/Sortable/issues/224","id":54516015,"number":224,"title":"When onAdd function is triggered, new item dragged is already into the list","user":{"login":"romanrdgz","id":3307742,"avatar_url":"https://avatars.githubusercontent.com/u/3307742?v=3","gravatar_id":"","url":"https://api.github.com/users/romanrdgz","html_url":"https://github.com/romanrdgz","followers_url":"https://api.github.com/users/romanrdgz/followers","following_url":"https://api.github.com/users/romanrdgz/following{/other_user}","gists_url":"https://api.github.com/users/romanrdgz/gists{/gist_id}","starred_url":"https://api.github.com/users/romanrdgz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/romanrdgz/subscriptions","organizations_url":"https://api.github.com/users/romanrdgz/orgs","repos_url":"https://api.github.com/users/romanrdgz/repos","events_url":"https://api.github.com/users/romanrdgz/events{/privacy}","received_events_url":"https://api.github.com/users/romanrdgz/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-01-15T22:48:26Z","updated_at":"2015-01-16T17:28:01Z","closed_at":null,"body":"I am iterating all list elements in order to determine if the list already had the item I just droped into. I'm using Jquery:\r\n\r\n```js\r\n$(\"#li\").each(function(){ }\r\n```\r\n\r\nBut the item just dropped is already there. Is there other event triggered before onAdd which would allow me to iterate list items before inserting the new item?"},"comment":{"url":"https://api.github.com/repos/RubaXa/Sortable/issues/comments/70289237","html_url":"https://github.com/RubaXa/Sortable/issues/224#issuecomment-70289237","issue_url":"https://api.github.com/repos/RubaXa/Sortable/issues/224","id":70289237,"user":{"login":"dandv","id":33569,"avatar_url":"https://avatars.githubusercontent.com/u/33569?v=3","gravatar_id":"","url":"https://api.github.com/users/dandv","html_url":"https://github.com/dandv","followers_url":"https://api.github.com/users/dandv/followers","following_url":"https://api.github.com/users/dandv/following{/other_user}","gists_url":"https://api.github.com/users/dandv/gists{/gist_id}","starred_url":"https://api.github.com/users/dandv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dandv/subscriptions","organizations_url":"https://api.github.com/users/dandv/orgs","repos_url":"https://api.github.com/users/dandv/repos","events_url":"https://api.github.com/users/dandv/events{/privacy}","received_events_url":"https://api.github.com/users/dandv/received_events","type":"User","site_admin":false},"created_at":"2015-01-16T17:28:01Z","updated_at":"2015-01-16T17:28:01Z","body":"> What I am trying to achieve, is to detect if the dropped element was already in the list, so I can avoid duplicates and increment the badge indicating the number of that element into the list.\r\n\r\nThat's a legitimate use case.\r\n\r\nHave you tried using `onEnd`?"}}