{"action":"created","issue":{"url":"https://api.github.com/repos/angular-ui/ui-select/issues/520","labels_url":"https://api.github.com/repos/angular-ui/ui-select/issues/520/labels{/name}","comments_url":"https://api.github.com/repos/angular-ui/ui-select/issues/520/comments","events_url":"https://api.github.com/repos/angular-ui/ui-select/issues/520/events","html_url":"https://github.com/angular-ui/ui-select/issues/520","id":52142431,"number":520,"title":"Null tag added to list (race condition)","user":{"login":"aeharding","id":2166114,"avatar_url":"https://avatars.githubusercontent.com/u/2166114?v=3","gravatar_id":"","url":"https://api.github.com/users/aeharding","html_url":"https://github.com/aeharding","followers_url":"https://api.github.com/users/aeharding/followers","following_url":"https://api.github.com/users/aeharding/following{/other_user}","gists_url":"https://api.github.com/users/aeharding/gists{/gist_id}","starred_url":"https://api.github.com/users/aeharding/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aeharding/subscriptions","organizations_url":"https://api.github.com/users/aeharding/orgs","repos_url":"https://api.github.com/users/aeharding/repos","events_url":"https://api.github.com/users/aeharding/events{/privacy}","received_events_url":"https://api.github.com/users/aeharding/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2014-12-16T17:31:24Z","updated_at":"2015-01-11T09:20:55Z","closed_at":null,"body":"Hi guys,\r\n\r\nI'm happy that tagging is being added to ui-select, however, it's still pretty rough around the edges. 0.9.5 fixed a lot of the things that made it unusable (couldn't select first thing, other breaking stuff), but I've encountered another smaller issue with 0.9.5.\r\n\r\nhttp://plnkr.co/edit/Yx4I7EEM7jn7XVdKqsbL?p=preview\r\n![image](https://cloud.githubusercontent.com/assets/2166114/5458339/fc009596-8516-11e4-8e99-b2b1f7ccc1ea.png)\r\n\r\nClick inside the input area, and then type a comma and then hit enter very quickly (it doesn't occur when you press comma and then spacebar, for some reason). A null item will be added to the array of items, which is annoying since it causes many errors in the console, and cannot be removed by clicking the 'x' or using the delete button.\r\n\r\nAlso, why does the dropdown flicker when tagging is enabled? It's kinda annoying, and it'd be nice if that could be fixed.\r\n\r\nI appreciate the work done here guys!"},"comment":{"url":"https://api.github.com/repos/angular-ui/ui-select/issues/comments/69488254","html_url":"https://github.com/angular-ui/ui-select/issues/520#issuecomment-69488254","issue_url":"https://api.github.com/repos/angular-ui/ui-select/issues/520","id":69488254,"user":{"login":"NJAldwin","id":145036,"avatar_url":"https://avatars.githubusercontent.com/u/145036?v=3","gravatar_id":"","url":"https://api.github.com/users/NJAldwin","html_url":"https://github.com/NJAldwin","followers_url":"https://api.github.com/users/NJAldwin/followers","following_url":"https://api.github.com/users/NJAldwin/following{/other_user}","gists_url":"https://api.github.com/users/NJAldwin/gists{/gist_id}","starred_url":"https://api.github.com/users/NJAldwin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NJAldwin/subscriptions","organizations_url":"https://api.github.com/users/NJAldwin/orgs","repos_url":"https://api.github.com/users/NJAldwin/repos","events_url":"https://api.github.com/users/NJAldwin/events{/privacy}","received_events_url":"https://api.github.com/users/NJAldwin/received_events","type":"User","site_admin":false},"created_at":"2015-01-11T09:20:55Z","updated_at":"2015-01-11T09:20:55Z","body":"I'm seeing this as well, though it's not a race condition in this case.  Pressing the down arrow (to open the dropdown), then pressing the up arrow (to deselect anything), then pressing enter causes a null element to be added.  The null element does not appear in the list, so it probably shouldn't be able to be selected.\r\n\r\n![dropdown with nothing selected](https://cloud.githubusercontent.com/assets/145036/5694748/4154e1c2-9946-11e4-8c07-76002975c3ff.png)\r\n\r\n![dropdown with a null element](https://cloud.githubusercontent.com/assets/145036/5694746/117dbbd6-9946-11e4-9b3a-d4c0dc8d52f9.png)\r\n\r\nFurthermore, this null element does not seem to be removable, instead throwing this:\r\n\r\n```\r\nTypeError: Cannot read property '_uiSelectChoiceLocked' of undefined\r\n    at ctrl.removeChoice (http://run.plnkr.co/Agl9e65wEUyqtG1P/select.js:497:23)\r\n    at getNewActiveMatchIndex (http://run.plnkr.co/Agl9e65wEUyqtG1P/select.js:609:20)\r\n    at _handleMatchSelection (http://run.plnkr.co/Agl9e65wEUyqtG1P/select.js:625:18)\r\n    at http://run.plnkr.co/Agl9e65wEUyqtG1P/select.js:648:23\r\n    at Scope.$eval (http://ajax.googleapis.com/ajax/libs/angularjs/1.2.18/angular.js:12556:28)\r\n    at Scope.$apply (http://ajax.googleapis.com/ajax/libs/angularjs/1.2.18/angular.js:12654:23)\r\n    at HTMLInputElement.<anonymous> (http://run.plnkr.co/Agl9e65wEUyqtG1P/select.js:643:14)\r\n    at http://ajax.googleapis.com/ajax/libs/angularjs/1.2.18/angular.js:2816:10\r\n    at Array.forEach (native)\r\n    at forEach (http://ajax.googleapis.com/ajax/libs/angularjs/1.2.18/angular.js:320:11)\r\n```\r\n\r\nSimilar behavior occurs in object-based tagging.  [Plunker demo](http://plnkr.co/edit/szYtoGgyFZVXAx12Y13c?p=preview)"}}