Selectmenu: click on the text of the button did not open the menu in Webkit browsers

This commit is contained in:
Felix Nagel 2013-02-08 22:05:26 +01:00
parent 91dde04dad
commit 3a17a91f30

View File

@ -174,7 +174,6 @@ $.widget( "ui.selectmenu", {
this.menu.menu( "refresh" ); this.menu.menu( "refresh" );
this.menuItems = this.menu.find( "li" ).not( ".ui-selectmenu-optgroup" ); this.menuItems = this.menu.find( "li" ).not( ".ui-selectmenu-optgroup" );
// select current item
item = this._getSelectedItem(); item = this._getSelectedItem();
// make sure menu is selected item aware // make sure menu is selected item aware
this.menu.menu( "focus", null, item ); this.menu.menu( "focus", null, item );
@ -365,6 +364,7 @@ $.widget( "ui.selectmenu", {
var oldIndex = this.element[ 0 ].selectedIndex; var oldIndex = this.element[ 0 ].selectedIndex;
// change native select element // change native select element
this.element[ 0 ].selectedIndex = item.index; this.element[ 0 ].selectedIndex = item.index;
this._setText( this.buttonText, item.label );
this._setSelected( item ); this._setSelected( item );
this._trigger( "select", event, { item: item } ); this._trigger( "select", event, { item: item } );
@ -374,7 +374,6 @@ $.widget( "ui.selectmenu", {
}, },
_setSelected: function( item ) { _setSelected: function( item ) {
this._setText( this.buttonText, item.label );
// change ARIA attr // change ARIA attr
this.menuItems.find( "a" ).attr( "aria-selected", false ); this.menuItems.find( "a" ).attr( "aria-selected", false );
this.menuItems.eq( item.index ).find( "a" ).attr( "aria-selected", true ); this.menuItems.eq( item.index ).find( "a" ).attr( "aria-selected", true );