{"action":"created","issue":{"url":"https://api.github.com/repos/bootstrap-tagsinput/bootstrap-tagsinput/issues/528","repository_url":"https://api.github.com/repos/bootstrap-tagsinput/bootstrap-tagsinput","labels_url":"https://api.github.com/repos/bootstrap-tagsinput/bootstrap-tagsinput/issues/528/labels{/name}","comments_url":"https://api.github.com/repos/bootstrap-tagsinput/bootstrap-tagsinput/issues/528/comments","events_url":"https://api.github.com/repos/bootstrap-tagsinput/bootstrap-tagsinput/issues/528/events","html_url":"https://github.com/bootstrap-tagsinput/bootstrap-tagsinput/issues/528","id":180670118,"number":528,"title":"calling .tagsinput('items') inside an beforeItemAdd event handler causes a lot recursion","user":{"login":"jkhsjdhjs","id":1429604,"avatar_url":"https://avatars.githubusercontent.com/u/1429604?v=3","gravatar_id":"","url":"https://api.github.com/users/jkhsjdhjs","html_url":"https://github.com/jkhsjdhjs","followers_url":"https://api.github.com/users/jkhsjdhjs/followers","following_url":"https://api.github.com/users/jkhsjdhjs/following{/other_user}","gists_url":"https://api.github.com/users/jkhsjdhjs/gists{/gist_id}","starred_url":"https://api.github.com/users/jkhsjdhjs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jkhsjdhjs/subscriptions","organizations_url":"https://api.github.com/users/jkhsjdhjs/orgs","repos_url":"https://api.github.com/users/jkhsjdhjs/repos","events_url":"https://api.github.com/users/jkhsjdhjs/events{/privacy}","received_events_url":"https://api.github.com/users/jkhsjdhjs/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-10-03T15:27:15Z","updated_at":"2016-10-04T00:58:44Z","closed_at":null,"body":"Let's say you have a usual tagsinput form and you attach an `beforeItemAdd` event handler to it, in that event handler you then use `$(this).tagsinput('items')` in any way. You should now have something like this:\r\n\r\n```javascript\r\n$('your tagsinput').on('beforeItemAdd', function() {\r\n    console.log($(this).tagsinput('items'));\r\n});\r\n```\r\n\r\nThen you load the page where the tagsinput is located.\r\nIt will cause high CPU usage for your browser and firebug showed 'too much recursion'\r\nIt will also duplicate your tagsinput form about 300 times."},"comment":{"url":"https://api.github.com/repos/bootstrap-tagsinput/bootstrap-tagsinput/issues/comments/251269093","html_url":"https://github.com/bootstrap-tagsinput/bootstrap-tagsinput/issues/528#issuecomment-251269093","issue_url":"https://api.github.com/repos/bootstrap-tagsinput/bootstrap-tagsinput/issues/528","id":251269093,"user":{"login":"lucknerjb","id":832836,"avatar_url":"https://avatars.githubusercontent.com/u/832836?v=3","gravatar_id":"","url":"https://api.github.com/users/lucknerjb","html_url":"https://github.com/lucknerjb","followers_url":"https://api.github.com/users/lucknerjb/followers","following_url":"https://api.github.com/users/lucknerjb/following{/other_user}","gists_url":"https://api.github.com/users/lucknerjb/gists{/gist_id}","starred_url":"https://api.github.com/users/lucknerjb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lucknerjb/subscriptions","organizations_url":"https://api.github.com/users/lucknerjb/orgs","repos_url":"https://api.github.com/users/lucknerjb/repos","events_url":"https://api.github.com/users/lucknerjb/events{/privacy}","received_events_url":"https://api.github.com/users/lucknerjb/received_events","type":"User","site_admin":false},"created_at":"2016-10-04T00:58:44Z","updated_at":"2016-10-04T00:58:44Z","body":"After spending a little bit of time looking into this, the issue comes from not wrapping that chunk of JS in a `document.ready` function. I'm still not exactly 100% sure why not doing so causes an issue but that's the cause."}}
{"actor":{"display_login":"lucknerjb"}}