]> source.dussan.org Git - jquery-ui.git/commitdiff
Selectmenu: update button text when selected option is added
authorFelix Nagel <info@felixnagel.com>
Sat, 31 Aug 2013 01:09:57 +0000 (03:09 +0200)
committerFelix Nagel <info@felixnagel.com>
Sat, 31 Aug 2013 01:09:57 +0000 (03:09 +0200)
ui/jquery.ui.selectmenu.js

index bc7eae1bd441f6b328dd70f72144cb37dc1679ac..6685229d5068c8f80dc455371f41c46d0212163e 100644 (file)
@@ -179,6 +179,8 @@ $.widget( "ui.selectmenu", {
                // Make sure menu is selected item aware
                this.menu.menu( "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" ) );