Skip to content
Permalink
Browse files

button: add ui-state-active on keydown, further improving keyboard na…

…vigation - doesn't yet work properly for anchors and radio/checkbox buttons
  • Loading branch information
jzaefferer committed Jan 22, 2010
1 parent cc77201 commit 967454c43443e19b270f13be3840c451edecdfbc
Showing with 8 additions and 0 deletions.
  1. +8 −0 ui/jquery.ui.button.js
@@ -128,6 +128,14 @@ $.widget( "ui.button", {
return;
}
$( this ).removeClass( "ui-state-active" );
})
.bind( "keydown.button", function(event) {
if ( event.keyCode == $.ui.keyCode.SPACE || event.keyCode == $.ui.keyCode.ENTER ) {
$( this ).addClass( "ui-state-active" );
}
})
.bind( "keyup.button", function() {
$( this ).removeClass( "ui-state-active" );
});
}

0 comments on commit 967454c

Please sign in to comment.
You can’t perform that action at this time.