Selectmenu: Select value when closing with space

This commit is contained in:
Jörn Zaefferer 2012-12-09 12:58:47 +01:00
parent 15032d17d9
commit 2845d38d40

View File

@ -346,7 +346,11 @@ $.widget( "ui.selectmenu", {
} }
break; break;
case $.ui.keyCode.SPACE: case $.ui.keyCode.SPACE:
this._toggle( event ); if ( this.isOpen ) {
this.menu.menu( "select", event );
} else {
this._toggle( event );
}
break; break;
case $.ui.keyCode.LEFT: case $.ui.keyCode.LEFT:
this._move( "previous", event ); this._move( "previous", event );