.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
.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() {