Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
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

@gkalpak

Description

@gkalpak

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions