Skip to content
Browse files

Selectmenu: fix keyboard control issue

  • Loading branch information...
1 parent f08b0af commit f128292636a0cd6d583c485b62407186d8aa62cc @fnagel fnagel committed Mar 7, 2013
Showing with 8 additions and 7 deletions.
  1. +8 −7 ui/jquery.ui.selectmenu.js
View
15 ui/jquery.ui.selectmenu.js
@@ -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;

0 comments on commit f128292

Please sign in to comment.
Something went wrong with that request. Please try again.