mirror of
https://github.com/jquery/jquery-ui.git
synced 2025-01-07 20:34:24 +00:00
Selectmenu: fix keyboard control issue
This commit is contained in:
parent
f08b0af1be
commit
f128292636
15
ui/jquery.ui.selectmenu.js
vendored
15
ui/jquery.ui.selectmenu.js
vendored
@ -297,11 +297,7 @@ $.widget( "ui.selectmenu", {
|
||||
this._off( this.button, "focus" );
|
||||
},
|
||||
click: function( event ) {
|
||||
if ( this.isOpen ) {
|
||||
this.menu.menu( "select", event );
|
||||
} else {
|
||||
this._toggle( event );
|
||||
}
|
||||
this._toggle( event );
|
||||
event.preventDefault();
|
||||
},
|
||||
keydown: function( event ) {
|
||||
@ -333,6 +329,13 @@ $.widget( "ui.selectmenu", {
|
||||
this._move( "next", event );
|
||||
}
|
||||
break;
|
||||
case $.ui.keyCode.SPACE:
|
||||
if ( this.isOpen ) {
|
||||
this.menu.menu( "select", event );
|
||||
} else {
|
||||
this._toggle( event );
|
||||
}
|
||||
break;
|
||||
case $.ui.keyCode.LEFT:
|
||||
this._move( "previous", event );
|
||||
break;
|
||||
@ -347,8 +350,6 @@ $.widget( "ui.selectmenu", {
|
||||
case $.ui.keyCode.PAGE_DOWN:
|
||||
this._move( "last", event );
|
||||
break;
|
||||
case $.ui.keyCode.SPACE:
|
||||
break;
|
||||
default:
|
||||
this.menu.trigger( event );
|
||||
prevDef = false;
|
||||
|
Loading…
Reference in New Issue
Block a user