Skip to content
Permalink
Browse files

Menu: If the active element no longer exists after a refresh, blur th…

…e menu.
  • Loading branch information
scottgonzalez committed Aug 27, 2012
1 parent b22e3c3 commit 93556a8e18be972d487498a42b3916f8fff9e995
Showing with 5 additions and 2 deletions.
  1. +0 −2 ui/jquery.ui.autocomplete.js
  2. +5 −0 ui/jquery.ui.menu.js
@@ -482,8 +482,6 @@ $.widget( "ui.autocomplete", {
.empty()
.zIndex( this.element.zIndex() + 1 );
this._renderMenu( ul, items );
// TODO refresh should check if the active item is still in the dom, removing the need for a manual blur
this.menu.blur();
this.menu.refresh();

// size and position menu
@@ -319,6 +319,11 @@ $.widget( "ui.menu", {
.prepend( submenuCarat );
menu.attr( "aria-labelledby", item.attr( "id" ) );
});

// If the active item has been removed, blur the menu
if ( this.active && !$.contains( this.element[ 0 ], this.active[ 0 ] ) ) {
this.blur();
}
},

_itemRole: function() {

0 comments on commit 93556a8

Please sign in to comment.
You can’t perform that action at this time.