]> source.dussan.org Git - jquery-ui.git/commitdiff
Menu: Check that there is an active item in `_activate()`
authorRand Scullard <rand@randscullard.com>
Mon, 28 Sep 2015 20:15:46 +0000 (16:15 -0400)
committerScott González <scott.gonzalez@gmail.com>
Wed, 30 Mar 2016 18:43:03 +0000 (14:43 -0400)
Closes gh-1606

ui/widgets/menu.js

index c5627cc20713ef93c5796cfbb8113eb94542307d..f63105fa771004e984b48a3e4e47b8fbfa0bffa7 100644 (file)
@@ -270,7 +270,7 @@ return $.widget( "ui.menu", {
        },
 
        _activate: function( event ) {
-               if ( !this.active.is( ".ui-state-disabled" ) ) {
+               if ( this.active && !this.active.is( ".ui-state-disabled" ) ) {
                        if ( this.active.children( "[aria-haspopup='true']" ).length ) {
                                this.expand( event );
                        } else {