diff options
author | Felix Nagel <info@felixnagel.com> | 2013-09-26 01:10:16 +0200 |
---|---|---|
committer | Felix Nagel <info@felixnagel.com> | 2013-09-26 01:10:16 +0200 |
commit | b1532ed4aebfb45d96e096d0c163838fa6e42394 (patch) | |
tree | 5bddece8cb6f4a40904b873fd27b053803c29a62 /ui/jquery.ui.selectmenu.js | |
parent | b80681c74ec8e82e17b4827f249476e1923a0a05 (diff) | |
download | jquery-ui-b1532ed4aebfb45d96e096d0c163838fa6e42394.tar.gz jquery-ui-b1532ed4aebfb45d96e096d0c163838fa6e42394.zip |
Selectmenu: Click on button text does not open menu in Webkit browsers
Diffstat (limited to 'ui/jquery.ui.selectmenu.js')
-rw-r--r-- | ui/jquery.ui.selectmenu.js | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/ui/jquery.ui.selectmenu.js b/ui/jquery.ui.selectmenu.js index 281674455..a5f9485bd 100644 --- a/ui/jquery.ui.selectmenu.js +++ b/ui/jquery.ui.selectmenu.js @@ -120,7 +120,7 @@ $.widget( "ui.selectmenu", { this.menuInstance = this.menu.menu({ role: "listbox", select: function( event, ui ) { - event.preventDefault(); + event.preventDefault(); that._select( ui.item.data( "ui-selectmenu-item" ), event ); }, focus: function( event, ui ) { @@ -156,6 +156,11 @@ $.widget( "ui.selectmenu", { }, refresh: function() { + this._refreshMenu(); + this._setText( this.buttonText, this._getSelectedItem().text() ); + }, + + _refreshMenu: function() { this.menu.empty(); var item, @@ -177,8 +182,6 @@ $.widget( "ui.selectmenu", { this.menuInstance.focus( null, item ); this._setAria( item.data( "ui-selectmenu-item" ) ); - this._setText( this.buttonText, item.text() ); - // Set disabled state this._setOption( "disabled", this.element.prop( "disabled" ) ); }, @@ -190,7 +193,7 @@ $.widget( "ui.selectmenu", { // If this is the first time the menu is being opened, render the items if ( !this.menuItems ) { - this.refresh(); + this._refreshMenu(); } else { // TODO: Why is this necessary? // Shouldn't the underlying menu always have accurate state? @@ -320,7 +323,7 @@ $.widget( "ui.selectmenu", { focusin: function() { // Delay rendering the menu items until the button receives focus if ( !this.menuItems ) { - this.refresh(); + this._refreshMenu(); } this._off( this.button, "focusin" ); }, |