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

feat(ngAria[ngClick]): preventDefault on pressing Space so the page doesn't scroll #14665

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/ngAria/aria.js
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,7 @@ ngAriaModule.directive('ngShow', ['$aria', function($aria) {
elem.on('keypress', function(event) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

32

var keyCode = event.which || event.keyCode;
if (keyCode === 32 || keyCode === 13) {
event.preventDefault();
scope.$apply(callback);
}

Expand Down