Skip to content

Commit

Permalink
Merge branch 'sub-menu-changes' of github.com:browserstack/a11y-engin…
Browse files Browse the repository at this point in the history
…e-axe-core into menu-result-changes
  • Loading branch information
SwarajGK committed Dec 6, 2024
2 parents ac57923 + 8292c0a commit 2548867
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion lib/core/base/rule.js
Original file line number Diff line number Diff line change
Expand Up @@ -585,13 +585,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;
};
Expand Down

0 comments on commit 2548867

Please sign in to comment.