{"action":"created","issue":{"url":"https://api.github.com/repos/angular/angular.js/issues/10388","labels_url":"https://api.github.com/repos/angular/angular.js/issues/10388/labels{/name}","comments_url":"https://api.github.com/repos/angular/angular.js/issues/10388/comments","events_url":"https://api.github.com/repos/angular/angular.js/issues/10388/events","html_url":"https://github.com/angular/angular.js/issues/10388","id":51474186,"number":10388,"title":"bug(ngAria): ng-click adds keypress event to buttons which already fire a click event on \"enter\"","user":{"login":"kentcdodds","id":1500684,"avatar_url":"https://avatars.githubusercontent.com/u/1500684?v=3","gravatar_id":"","url":"https://api.github.com/users/kentcdodds","html_url":"https://github.com/kentcdodds","followers_url":"https://api.github.com/users/kentcdodds/followers","following_url":"https://api.github.com/users/kentcdodds/following{/other_user}","gists_url":"https://api.github.com/users/kentcdodds/gists{/gist_id}","starred_url":"https://api.github.com/users/kentcdodds/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kentcdodds/subscriptions","organizations_url":"https://api.github.com/users/kentcdodds/orgs","repos_url":"https://api.github.com/users/kentcdodds/repos","events_url":"https://api.github.com/users/kentcdodds/events{/privacy}","received_events_url":"https://api.github.com/users/kentcdodds/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/angular/angular.js/labels/component%3A+ngAria","name":"component: ngAria","color":"bfe5bf"},{"url":"https://api.github.com/repos/angular/angular.js/labels/frequency%3A+moderate","name":"frequency: moderate","color":"fef2c0"},{"url":"https://api.github.com/repos/angular/angular.js/labels/PRs+plz%21","name":"PRs plz!","color":"02d7e1"},{"url":"https://api.github.com/repos/angular/angular.js/labels/type%3A+bug","name":"type: bug","color":"000000"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/angular/angular.js/milestones/32","labels_url":"https://api.github.com/repos/angular/angular.js/milestones/32/labels","id":510155,"number":32,"title":"1.3.x","description":"","creator":{"login":"tbosch","id":690815,"avatar_url":"https://avatars.githubusercontent.com/u/690815?v=3","gravatar_id":"","url":"https://api.github.com/users/tbosch","html_url":"https://github.com/tbosch","followers_url":"https://api.github.com/users/tbosch/followers","following_url":"https://api.github.com/users/tbosch/following{/other_user}","gists_url":"https://api.github.com/users/tbosch/gists{/gist_id}","starred_url":"https://api.github.com/users/tbosch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tbosch/subscriptions","organizations_url":"https://api.github.com/users/tbosch/orgs","repos_url":"https://api.github.com/users/tbosch/repos","events_url":"https://api.github.com/users/tbosch/events{/privacy}","received_events_url":"https://api.github.com/users/tbosch/received_events","type":"User","site_admin":false},"open_issues":116,"closed_issues":285,"state":"open","created_at":"2013-12-10T19:41:50Z","updated_at":"2015-01-14T20:41:44Z","due_on":null,"closed_at":null},"comments":17,"created_at":"2014-12-09T20:00:38Z","updated_at":"2015-01-15T19:23:51Z","closed_at":null,"body":"Originally discussed [here](https://github.com/angular/angular.js/pull/10288#issuecomment-66345338) in pull #10288 \r\n\r\n > Hmmmm. Looks like this introduces [a bug](http://jsbin.com/relejeguke/2/edit)? Looks like this is a problem in Chrome, Firefox, and Safari. Tab to the button (turns red) and hit \"Enter\" and the alert pops up twice. This is because (I believe) that the aforementioned browsers will fire a \"clicked\" event when the \"enter\" key is pressed.\r\n\r\nFix suggested by @marcysutton:\r\n\r\n> Ahh, I see that. Good catch! It should only bind on a custom control that doesn't already have keyboard support. The approach used for adding roles in this PR would work:\r\n> https://github.com/angular/angular.js/pull/10318/files#diff-91e9129201746ba107348c9a0a7735edR333"},"comment":{"url":"https://api.github.com/repos/angular/angular.js/issues/comments/70144947","html_url":"https://github.com/angular/angular.js/issues/10388#issuecomment-70144947","issue_url":"https://api.github.com/repos/angular/angular.js/issues/10388","id":70144947,"user":{"login":"marcysutton","id":1045233,"avatar_url":"https://avatars.githubusercontent.com/u/1045233?v=3","gravatar_id":"","url":"https://api.github.com/users/marcysutton","html_url":"https://github.com/marcysutton","followers_url":"https://api.github.com/users/marcysutton/followers","following_url":"https://api.github.com/users/marcysutton/following{/other_user}","gists_url":"https://api.github.com/users/marcysutton/gists{/gist_id}","starred_url":"https://api.github.com/users/marcysutton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marcysutton/subscriptions","organizations_url":"https://api.github.com/users/marcysutton/orgs","repos_url":"https://api.github.com/users/marcysutton/repos","events_url":"https://api.github.com/users/marcysutton/events{/privacy}","received_events_url":"https://api.github.com/users/marcysutton/received_events","type":"User","site_admin":false},"created_at":"2015-01-15T19:23:51Z","updated_at":"2015-01-15T19:23:51Z","body":"It is opt-in in terms of the flag, but the `keypress` event is also bound for all elements with `ng-click` regardless of whether they needed it (resulting in two events on `button`). The common thing we're trying to fix with this is ng-click on `<div>`, which doesn't fire keypress by default. I think we should also consider adding `<li>` since people love to put `:hover` and `ng-click` on it.\r\n\r\nIf the [PR for adding roles](https://github.com/angular/angular.js/issues/10012) goes in, it should not add `role=\"button\"` to `<li>` since those already have semantics. `<div role=\"button\">` is pretty safe."}}