mirror of
https://github.com/jquery/jquery-ui.git
synced 2024-11-21 11:04:24 +00:00
button: handle space "click"
This commit is contained in:
parent
967454c434
commit
aa63c4b959
8
ui/jquery.ui.button.js
vendored
8
ui/jquery.ui.button.js
vendored
@ -137,6 +137,14 @@ $.widget( "ui.button", {
|
||||
.bind( "keyup.button", function() {
|
||||
$( this ).removeClass( "ui-state-active" );
|
||||
});
|
||||
if (this.buttonElement.is("a")) {
|
||||
this.buttonElement.keyup(function(event) {
|
||||
if (event.keyCode == $.ui.keyCode.SPACE) {
|
||||
// TODO pass through original event correctly (just as 2nd argument doesn't work)
|
||||
$(this).trigger("click");
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
this._resetButton();
|
||||
|
Loading…
Reference in New Issue
Block a user