diff options
author | Scott González <scott.gonzalez@gmail.com> | 2014-04-08 11:19:26 -0400 |
---|---|---|
committer | Scott González <scott.gonzalez@gmail.com> | 2014-04-18 12:37:06 -0400 |
commit | 1272fca9eff68de09c4d71b68a6de79c8baae276 (patch) | |
tree | b736dbf55acae4dadad45e796939161b684c5b34 /ui/selectmenu.js | |
parent | 184965598013c2387903f40372b010e27c531bf6 (diff) | |
download | jquery-ui-1272fca9eff68de09c4d71b68a6de79c8baae276.tar.gz jquery-ui-1272fca9eff68de09c4d71b68a6de79c8baae276.zip |
Selectmenu: Don't use active items at all
Menus only use active items for nested menus which selectmenu doesn't support.
Selectmenu should only be working with focused items.
Ref gh-1224
Diffstat (limited to 'ui/selectmenu.js')
-rw-r--r-- | ui/selectmenu.js | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/ui/selectmenu.js b/ui/selectmenu.js index b227e196c..a612d1982 100644 --- a/ui/selectmenu.js +++ b/ui/selectmenu.js @@ -223,11 +223,10 @@ return $.widget( "ui.selectmenu", { if ( !this.menuItems ) { this._refreshMenu(); } else { - // TODO: Why is this necessary? - // Shouldn't the underlying menu always have accurate state? + + // Menu clears focus on close, reset focus to selected item this.menu.find( ".ui-state-focus" ).removeClass( "ui-state-focus" ); this.menuInstance.focus( null, this._getSelectedItem() ); - this.menuItems.eq( this.element[ 0 ].selectedIndex ).addClass( "ui-state-active" ); } this.isOpen = true; @@ -252,11 +251,6 @@ return $.widget( "ui.selectmenu", { this.isOpen = false; this._toggleAttr(); - // Check if we have an item to select - if ( this.menuItems ) { - this.menuInstance.active = this._getSelectedItem(); - } - this._off( this.document ); this._trigger( "close", event ); |