File tree Expand file tree Collapse file tree 1 file changed +21
-1
lines changed
Expand file tree Collapse file tree 1 file changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -585,13 +585,33 @@ Rule.prototype.after = function after(result, options) {
585585 // only add the node property for the check.after so we can
586586 // look at which iframe a check result came from, but we don't
587587 // want it for the final results object
588- delete item . node ;
588+ if ( check . id === 'menu-expand' || check . id === 'menu-popup' ) {
589+ if ( item ?. data ?. metaData ) {
590+ delete item . node ;
591+ item . result = true ;
592+ }
593+ } else {
594+ delete item . node ;
595+ }
589596 if ( afterResults . indexOf ( item ) === - 1 ) {
590597 item . filtered = true ;
591598 }
592599 } ) ;
593600 } ) ;
594601
602+ // Trying for sub-menu
603+ if ( result . id === 'menu-expand' || result . id === 'menu-popup' ) {
604+ const data = result . nodes . filter ( r => ! r . all [ 0 ] . result ) ;
605+ data . forEach ( r => {
606+ const node = r . all [ 0 ] . data ;
607+ r . node = new axe . utils . DqElement ( node ) ;
608+ } ) ;
609+
610+ result . nodes . forEach ( r => {
611+ delete r . all [ 0 ] . data ;
612+ } ) ;
613+ }
614+
595615 result . nodes = sanitizeNodes ( result ) ;
596616 return result ;
597617} ;
You can’t perform that action at this time.
0 commit comments