diff --git a/ui/jquery.ui.menu.js b/ui/jquery.ui.menu.js index 7704521fb..99df2e629 100644 --- a/ui/jquery.ui.menu.js +++ b/ui/jquery.ui.menu.js @@ -330,7 +330,7 @@ $.widget( "ui.menu", { // highlight active parent menu item, if any this.active.parent().closest( ".ui-menu-item" ).children( "a:first" ).addClass( "ui-state-active" ); - if ( event.type === "keydown" ) { + if ( event && event.type === "keydown" ) { this._close(); } else { this.timer = this._delay(function() {