From 93556a8e18be972d487498a42b3916f8fff9e995 Mon Sep 17 00:00:00 2001 From: Scott González Date: Mon, 27 Aug 2012 08:05:27 -0400 Subject: Menu: If the active element no longer exists after a refresh, blur the menu. --- ui/jquery.ui.menu.js | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'ui/jquery.ui.menu.js') diff --git a/ui/jquery.ui.menu.js b/ui/jquery.ui.menu.js index 78b602cce..333bc9a38 100644 --- a/ui/jquery.ui.menu.js +++ b/ui/jquery.ui.menu.js @@ -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() { -- cgit v1.2.3