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
13
ui/jquery.ui.selectmenu.js
vendored
13
ui/jquery.ui.selectmenu.js
vendored
@ -297,11 +297,7 @@ $.widget( "ui.selectmenu", {
|
|||||||
this._off( this.button, "focus" );
|
this._off( this.button, "focus" );
|
||||||
},
|
},
|
||||||
click: function( event ) {
|
click: function( event ) {
|
||||||
if ( this.isOpen ) {
|
|
||||||
this.menu.menu( "select", event );
|
|
||||||
} else {
|
|
||||||
this._toggle( event );
|
this._toggle( event );
|
||||||
}
|
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
},
|
},
|
||||||
keydown: function( event ) {
|
keydown: function( event ) {
|
||||||
@ -333,6 +329,13 @@ $.widget( "ui.selectmenu", {
|
|||||||
this._move( "next", event );
|
this._move( "next", event );
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case $.ui.keyCode.SPACE:
|
||||||
|
if ( this.isOpen ) {
|
||||||
|
this.menu.menu( "select", event );
|
||||||
|
} else {
|
||||||
|
this._toggle( event );
|
||||||
|
}
|
||||||
|
break;
|
||||||
case $.ui.keyCode.LEFT:
|
case $.ui.keyCode.LEFT:
|
||||||
this._move( "previous", event );
|
this._move( "previous", event );
|
||||||
break;
|
break;
|
||||||
@ -347,8 +350,6 @@ $.widget( "ui.selectmenu", {
|
|||||||
case $.ui.keyCode.PAGE_DOWN:
|
case $.ui.keyCode.PAGE_DOWN:
|
||||||
this._move( "last", event );
|
this._move( "last", event );
|
||||||
break;
|
break;
|
||||||
case $.ui.keyCode.SPACE:
|
|
||||||
break;
|
|
||||||
default:
|
default:
|
||||||
this.menu.trigger( event );
|
this.menu.trigger( event );
|
||||||
prevDef = false;
|
prevDef = false;
|
||||||
|
Loading…
Reference in New Issue
Block a user