Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

fix(ngAria): bind to keydown instead of keypress in ngClick #14063

Closed
gkalpak opened this issue Feb 16, 2016 · 0 comments
Closed

fix(ngAria): bind to keydown instead of keypress in ngClick #14063

gkalpak opened this issue Feb 16, 2016 · 0 comments

Comments

@gkalpak
Copy link
Member

gkalpak commented Feb 16, 2016

ngAria's ngClick (among other things) tries to emulate the behavior of native buttons for non-button elements (e.g. <div>, <li> etc) used as button. Using native buttons is strongly recommended, but we should still try to make things accessible, even if the developer chooses to not follow the best practice 😃

Currently, we detect "clicks" by listening to keypress events. Switching to keydown instead, would make the behavior more consistent with how the browser fires click events on native buttons.

Also, discussed in https://github.com/angular/angular.js/pull/13996/files#r52934300.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant