{"action":"created","comment":{"url":"https://api.github.com/repos/angular/material/pulls/comments/27740966","id":27740966,"diff_hunk":"@@ -64,27 +70,57 @@\n    * if the current buffer is empty.\n    * @param event\n    */\n-  MdChipsCtrl.prototype.defaultInputKeydown = function(event) {\n+  MdChipsCtrl.prototype.inputKeydown = function(event) {\n     switch (event.keyCode) {\n       case this.$mdConstant.KEY_CODE.ENTER:\n-        if ( this.chipBuffer ) {\n+        var chipBuffer = this.getChipBuffer();\n+        if (chipBuffer) {\n           event.preventDefault();\n-          this.appendChipBuffer();\n+          this.appendChip(chipBuffer);\n+          this.resetChipBuffer();\n         }\n         break;\n       case this.$mdConstant.KEY_CODE.BACKSPACE: // backspace\n         if (!this.chipBuffer) {\n-\t\t\t\t\tevent.preventDefault();\n+          event.preventDefault();\n           // TODO(typotter): Probably want to open the previous one for edit instead.\n-          this.removeChip(this.items.length - 1);\n+          this.removeAndSelectAdjacentChip( this.items.length - 1);\n+          event.target.focus();\n         }\n         break;\n-      default:\n     }\n   };\n \n \n   /**\n+   * Handles the keydown event on an `<md-chip>` element.\n+   * @param index\n+   * @param event\n+   */\n+  MdChipsCtrl.prototype.chipKeydown = function(index, event) {\n+    switch (event.keyCode) {\n+      case this.$mdConstant.KEY_CODE.DELETE: // backspace","path":"src/components/chips/js/chipsController.js","position":94,"original_position":94,"commit_id":"89f5b1ddb61089e18c382d0998d66185324521c1","original_commit_id":"89f5b1ddb61089e18c382d0998d66185324521c1","user":{"login":"jelbourn","id":838736,"avatar_url":"https://avatars.githubusercontent.com/u/838736?v=3","gravatar_id":"","url":"https://api.github.com/users/jelbourn","html_url":"https://github.com/jelbourn","followers_url":"https://api.github.com/users/jelbourn/followers","following_url":"https://api.github.com/users/jelbourn/following{/other_user}","gists_url":"https://api.github.com/users/jelbourn/gists{/gist_id}","starred_url":"https://api.github.com/users/jelbourn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jelbourn/subscriptions","organizations_url":"https://api.github.com/users/jelbourn/orgs","repos_url":"https://api.github.com/users/jelbourn/repos","events_url":"https://api.github.com/users/jelbourn/events{/privacy}","received_events_url":"https://api.github.com/users/jelbourn/received_events","type":"User","site_admin":false},"body":"Delete and backspace should both probably do the same thing here. ","created_at":"2015-04-03T17:12:30Z","updated_at":"2015-04-03T17:12:30Z","html_url":"https://github.com/angular/material/pull/2152#discussion_r27740966","pull_request_url":"https://api.github.com/repos/angular/material/pulls/2152","_links":{"self":{"href":"https://api.github.com/repos/angular/material/pulls/comments/27740966"},"html":{"href":"https://github.com/angular/material/pull/2152#discussion_r27740966"},"pull_request":{"href":"https://api.github.com/repos/angular/material/pulls/2152"}}},"pull_request":{"url":"https://api.github.com/repos/angular/material/pulls/2152","id":32599974,"html_url":"https://github.com/angular/material/pull/2152","diff_url":"https://github.com/angular/material/pull/2152.diff","patch_url":"https://github.com/angular/material/pull/2152.patch","issue_url":"https://api.github.com/repos/angular/material/issues/2152","number":2152,"state":"open","locked":false,"title":"enhance(chips): Many updates to Chips","user":{"login":"typotter","id":9689485,"avatar_url":"https://avatars.githubusercontent.com/u/9689485?v=3","gravatar_id":"","url":"https://api.github.com/users/typotter","html_url":"https://github.com/typotter","followers_url":"https://api.github.com/users/typotter/followers","following_url":"https://api.github.com/users/typotter/following{/other_user}","gists_url":"https://api.github.com/users/typotter/gists{/gist_id}","starred_url":"https://api.github.com/users/typotter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/typotter/subscriptions","organizations_url":"https://api.github.com/users/typotter/orgs","repos_url":"https://api.github.com/users/typotter/repos","events_url":"https://api.github.com/users/typotter/events{/privacy}","received_events_url":"https://api.github.com/users/typotter/received_events","type":"User","site_admin":false},"body":"- Brought style (closer) to spec\r\n- support user pass mdautocomplete and input elements\r\n- tests for mdchipappend\r\n- update demo formatting, structure\r\n- Aria Fixes #2145\r\n- Style fixes #2123\r\n- insert default md-remove when none provided\r\n- make md-chip-remove a sibling to the chip content so that there is no nested ng-click\r\n- refactor DSL API to use md-chip-template instead of md-chip\r\n- support static chips\r\n- delete key on selected chip deletes it","created_at":"2015-04-03T16:39:02Z","updated_at":"2015-04-03T17:12:30Z","closed_at":null,"merged_at":null,"merge_commit_sha":"81e6cf79c94b52229c8118c9808c8436b4bf9d1c","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/angular/material/pulls/2152/commits","review_comments_url":"https://api.github.com/repos/angular/material/pulls/2152/comments","review_comment_url":"https://api.github.com/repos/angular/material/pulls/comments{/number}","comments_url":"https://api.github.com/repos/angular/material/issues/2152/comments","statuses_url":"https://api.github.com/repos/angular/material/statuses/89f5b1ddb61089e18c382d0998d66185324521c1","head":{"label":"typotter:wip-chips","ref":"wip-chips","sha":"89f5b1ddb61089e18c382d0998d66185324521c1","user":{"login":"typotter","id":9689485,"avatar_url":"https://avatars.githubusercontent.com/u/9689485?v=3","gravatar_id":"","url":"https://api.github.com/users/typotter","html_url":"https://github.com/typotter","followers_url":"https://api.github.com/users/typotter/followers","following_url":"https://api.github.com/users/typotter/following{/other_user}","gists_url":"https://api.github.com/users/typotter/gists{/gist_id}","starred_url":"https://api.github.com/users/typotter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/typotter/subscriptions","organizations_url":"https://api.github.com/users/typotter/orgs","repos_url":"https://api.github.com/users/typotter/repos","events_url":"https://api.github.com/users/typotter/events{/privacy}","received_events_url":"https://api.github.com/users/typotter/received_events","type":"User","site_admin":false},"repo":{"id":32410212,"name":"material","full_name":"typotter/material","owner":{"login":"typotter","id":9689485,"avatar_url":"https://avatars.githubusercontent.com/u/9689485?v=3","gravatar_id":"","url":"https://api.github.com/users/typotter","html_url":"https://github.com/typotter","followers_url":"https://api.github.com/users/typotter/followers","following_url":"https://api.github.com/users/typotter/following{/other_user}","gists_url":"https://api.github.com/users/typotter/gists{/gist_id}","starred_url":"https://api.github.com/users/typotter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/typotter/subscriptions","organizations_url":"https://api.github.com/users/typotter/orgs","repos_url":"https://api.github.com/users/typotter/repos","events_url":"https://api.github.com/users/typotter/events{/privacy}","received_events_url":"https://api.github.com/users/typotter/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/typotter/material","description":"Material design for Angular","fork":true,"url":"https://api.github.com/repos/typotter/material","forks_url":"https://api.github.com/repos/typotter/material/forks","keys_url":"https://api.github.com/repos/typotter/material/keys{/key_id}","collaborators_url":"https://api.github.com/repos/typotter/material/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/typotter/material/teams","hooks_url":"https://api.github.com/repos/typotter/material/hooks","issue_events_url":"https://api.github.com/repos/typotter/material/issues/events{/number}","events_url":"https://api.github.com/repos/typotter/material/events","assignees_url":"https://api.github.com/repos/typotter/material/assignees{/user}","branches_url":"https://api.github.com/repos/typotter/material/branches{/branch}","tags_url":"https://api.github.com/repos/typotter/material/tags","blobs_url":"https://api.github.com/repos/typotter/material/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/typotter/material/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/typotter/material/git/refs{/sha}","trees_url":"https://api.github.com/repos/typotter/material/git/trees{/sha}","statuses_url":"https://api.github.com/repos/typotter/material/statuses/{sha}","languages_url":"https://api.github.com/repos/typotter/material/languages","stargazers_url":"https://api.github.com/repos/typotter/material/stargazers","contributors_url":"https://api.github.com/repos/typotter/material/contributors","subscribers_url":"https://api.github.com/repos/typotter/material/subscribers","subscription_url":"https://api.github.com/repos/typotter/material/subscription","commits_url":"https://api.github.com/repos/typotter/material/commits{/sha}","git_commits_url":"https://api.github.com/repos/typotter/material/git/commits{/sha}","comments_url":"https://api.github.com/repos/typotter/material/comments{/number}","issue_comment_url":"https://api.github.com/repos/typotter/material/issues/comments{/number}","contents_url":"https://api.github.com/repos/typotter/material/contents/{+path}","compare_url":"https://api.github.com/repos/typotter/material/compare/{base}...{head}","merges_url":"https://api.github.com/repos/typotter/material/merges","archive_url":"https://api.github.com/repos/typotter/material/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/typotter/material/downloads","issues_url":"https://api.github.com/repos/typotter/material/issues{/number}","pulls_url":"https://api.github.com/repos/typotter/material/pulls{/number}","milestones_url":"https://api.github.com/repos/typotter/material/milestones{/number}","notifications_url":"https://api.github.com/repos/typotter/material/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/typotter/material/labels{/name}","releases_url":"https://api.github.com/repos/typotter/material/releases{/id}","created_at":"2015-03-17T17:48:34Z","updated_at":"2015-04-02T14:04:16Z","pushed_at":"2015-04-03T16:49:32Z","git_url":"git://github.com/typotter/material.git","ssh_url":"git@github.com:typotter/material.git","clone_url":"https://github.com/typotter/material.git","svn_url":"https://github.com/typotter/material","homepage":"https://material.angularjs.org/","size":35820,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"angular:master","ref":"master","sha":"d47b03a3c763c5abef2d9a184dfb1a9f618c8272","user":{"login":"angular","id":139426,"avatar_url":"https://avatars.githubusercontent.com/u/139426?v=3","gravatar_id":"","url":"https://api.github.com/users/angular","html_url":"https://github.com/angular","followers_url":"https://api.github.com/users/angular/followers","following_url":"https://api.github.com/users/angular/following{/other_user}","gists_url":"https://api.github.com/users/angular/gists{/gist_id}","starred_url":"https://api.github.com/users/angular/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/angular/subscriptions","organizations_url":"https://api.github.com/users/angular/orgs","repos_url":"https://api.github.com/users/angular/repos","events_url":"https://api.github.com/users/angular/events{/privacy}","received_events_url":"https://api.github.com/users/angular/received_events","type":"Organization","site_admin":false},"repo":{"id":21399598,"name":"material","full_name":"angular/material","owner":{"login":"angular","id":139426,"avatar_url":"https://avatars.githubusercontent.com/u/139426?v=3","gravatar_id":"","url":"https://api.github.com/users/angular","html_url":"https://github.com/angular","followers_url":"https://api.github.com/users/angular/followers","following_url":"https://api.github.com/users/angular/following{/other_user}","gists_url":"https://api.github.com/users/angular/gists{/gist_id}","starred_url":"https://api.github.com/users/angular/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/angular/subscriptions","organizations_url":"https://api.github.com/users/angular/orgs","repos_url":"https://api.github.com/users/angular/repos","events_url":"https://api.github.com/users/angular/events{/privacy}","received_events_url":"https://api.github.com/users/angular/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/angular/material","description":"Material design for Angular","fork":false,"url":"https://api.github.com/repos/angular/material","forks_url":"https://api.github.com/repos/angular/material/forks","keys_url":"https://api.github.com/repos/angular/material/keys{/key_id}","collaborators_url":"https://api.github.com/repos/angular/material/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/angular/material/teams","hooks_url":"https://api.github.com/repos/angular/material/hooks","issue_events_url":"https://api.github.com/repos/angular/material/issues/events{/number}","events_url":"https://api.github.com/repos/angular/material/events","assignees_url":"https://api.github.com/repos/angular/material/assignees{/user}","branches_url":"https://api.github.com/repos/angular/material/branches{/branch}","tags_url":"https://api.github.com/repos/angular/material/tags","blobs_url":"https://api.github.com/repos/angular/material/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/angular/material/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/angular/material/git/refs{/sha}","trees_url":"https://api.github.com/repos/angular/material/git/trees{/sha}","statuses_url":"https://api.github.com/repos/angular/material/statuses/{sha}","languages_url":"https://api.github.com/repos/angular/material/languages","stargazers_url":"https://api.github.com/repos/angular/material/stargazers","contributors_url":"https://api.github.com/repos/angular/material/contributors","subscribers_url":"https://api.github.com/repos/angular/material/subscribers","subscription_url":"https://api.github.com/repos/angular/material/subscription","commits_url":"https://api.github.com/repos/angular/material/commits{/sha}","git_commits_url":"https://api.github.com/repos/angular/material/git/commits{/sha}","comments_url":"https://api.github.com/repos/angular/material/comments{/number}","issue_comment_url":"https://api.github.com/repos/angular/material/issues/comments{/number}","contents_url":"https://api.github.com/repos/angular/material/contents/{+path}","compare_url":"https://api.github.com/repos/angular/material/compare/{base}...{head}","merges_url":"https://api.github.com/repos/angular/material/merges","archive_url":"https://api.github.com/repos/angular/material/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/angular/material/downloads","issues_url":"https://api.github.com/repos/angular/material/issues{/number}","pulls_url":"https://api.github.com/repos/angular/material/pulls{/number}","milestones_url":"https://api.github.com/repos/angular/material/milestones{/number}","notifications_url":"https://api.github.com/repos/angular/material/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/angular/material/labels{/name}","releases_url":"https://api.github.com/repos/angular/material/releases{/id}","created_at":"2014-07-01T19:20:06Z","updated_at":"2015-04-03T16:51:40Z","pushed_at":"2015-04-03T16:49:32Z","git_url":"git://github.com/angular/material.git","ssh_url":"git@github.com:angular/material.git","clone_url":"https://github.com/angular/material.git","svn_url":"https://github.com/angular/material","homepage":"https://material.angularjs.org/","size":83215,"stargazers_count":7644,"watchers_count":7644,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1068,"mirror_url":null,"open_issues_count":459,"forks":1068,"open_issues":459,"watchers":7644,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/angular/material/pulls/2152"},"html":{"href":"https://github.com/angular/material/pull/2152"},"issue":{"href":"https://api.github.com/repos/angular/material/issues/2152"},"comments":{"href":"https://api.github.com/repos/angular/material/issues/2152/comments"},"review_comments":{"href":"https://api.github.com/repos/angular/material/pulls/2152/comments"},"review_comment":{"href":"https://api.github.com/repos/angular/material/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/angular/material/pulls/2152/commits"},"statuses":{"href":"https://api.github.com/repos/angular/material/statuses/89f5b1ddb61089e18c382d0998d66185324521c1"}}}}