From 3a17a91f3001953418110b0417e195a7405d8d22 Mon Sep 17 00:00:00 2001 From: Felix Nagel Date: Fri, 8 Feb 2013 22:05:26 +0100 Subject: [PATCH] Selectmenu: click on the text of the button did not open the menu in Webkit browsers --- ui/jquery.ui.selectmenu.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ui/jquery.ui.selectmenu.js b/ui/jquery.ui.selectmenu.js index 70fa6952b..9055e2a0d 100644 --- a/ui/jquery.ui.selectmenu.js +++ b/ui/jquery.ui.selectmenu.js @@ -174,7 +174,6 @@ $.widget( "ui.selectmenu", { this.menu.menu( "refresh" ); this.menuItems = this.menu.find( "li" ).not( ".ui-selectmenu-optgroup" ); - // select current item item = this._getSelectedItem(); // make sure menu is selected item aware this.menu.menu( "focus", null, item ); @@ -365,6 +364,7 @@ $.widget( "ui.selectmenu", { var oldIndex = this.element[ 0 ].selectedIndex; // change native select element this.element[ 0 ].selectedIndex = item.index; + this._setText( this.buttonText, item.label ); this._setSelected( item ); this._trigger( "select", event, { item: item } ); @@ -374,7 +374,6 @@ $.widget( "ui.selectmenu", { }, _setSelected: function( item ) { - this._setText( this.buttonText, item.label ); // change ARIA attr this.menuItems.find( "a" ).attr( "aria-selected", false ); this.menuItems.eq( item.index ).find( "a" ).attr( "aria-selected", true );