Selectmenu: Switch to span to avoid cranky click/keydown event handling

This commit is contained in:
Jörn Zaefferer 2013-03-07 23:23:10 +01:00
parent 6e80a19d02
commit 022079a782

View File

@ -68,7 +68,7 @@ $.widget( "ui.selectmenu", {
this.element.hide(); this.element.hide();
// create button // create button
this.button = $( "<button>", { this.button = $( "<span>", {
"class": "ui-button ui-widget ui-state-default ui-corner-all", "class": "ui-button ui-widget ui-state-default ui-corner-all",
tabindex: ( tabindex ? tabindex : this.options.disabled ? -1 : 0 ), tabindex: ( tabindex ? tabindex : this.options.disabled ? -1 : 0 ),
id: this.ids.button, id: this.ids.button,
@ -332,8 +332,9 @@ $.widget( "ui.selectmenu", {
case $.ui.keyCode.SPACE: case $.ui.keyCode.SPACE:
if ( this.isOpen ) { if ( this.isOpen ) {
this.menu.menu( "select", event ); this.menu.menu( "select", event );
} else {
this._toggle( event );
} }
prevDef = false;
break; break;
case $.ui.keyCode.LEFT: case $.ui.keyCode.LEFT:
this._move( "previous", event ); this._move( "previous", event );