mirror of
https://github.com/jquery/jquery-ui.git
synced 2024-11-21 11:04:24 +00:00
button: add ui-state-active on keydown, further improving keyboard navigation - doesn't yet work properly for anchors and radio/checkbox buttons
This commit is contained in:
parent
cc77201c8e
commit
967454c434
8
ui/jquery.ui.button.js
vendored
8
ui/jquery.ui.button.js
vendored
@ -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" );
|
||||
});
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user