diff --git a/lib/core/base/rule.js b/lib/core/base/rule.js index e42c7429..89fc1dc6 100644 --- a/lib/core/base/rule.js +++ b/lib/core/base/rule.js @@ -583,13 +583,33 @@ Rule.prototype.after = function after(result, options) { // only add the node property for the check.after so we can // look at which iframe a check result came from, but we don't // want it for the final results object - delete item.node; + if (check.id === 'menu-expand' || check.id === 'menu-popup') { + if (item?.data?.metaData) { + delete item.node; + item.result = true; + } + } else { + delete item.node; + } if (afterResults.indexOf(item) === -1) { item.filtered = true; } }); }); + // Trying for sub-menu + if (result.id === 'menu-expand' || result.id === 'menu-popup') { + const data = result.nodes.filter(r => !r.all[0].result); + data.forEach(r => { + const node = r.all[0].data; + r.node = new axe.utils.DqElement(node); + }); + + result.nodes.forEach(r => { + delete r.all[0].data; + }); + } + result.nodes = sanitizeNodes(result); return result; }; diff --git a/lib/core/utils/check-helper.js b/lib/core/utils/check-helper.js index fbedf364..5aab8485 100644 --- a/lib/core/utils/check-helper.js +++ b/lib/core/utils/check-helper.js @@ -25,6 +25,9 @@ function checkHelper(checkResult, options, resolve, reject) { data(data) { checkResult.data = data; }, + getData() { + return checkResult.data; + }, relatedNodes(nodes) { if (!window.Node) { return;