fix(a11y): query only unignored nodes (#12224)

This commit is contained in:
Alex Rudenko 2024-04-05 20:33:01 +02:00 committed by GitHub
parent a63b8305ac
commit e20cd64fff
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -27,7 +27,16 @@ const queryAXTree = async (
role,
});
return nodes.filter((node: Protocol.Accessibility.AXNode) => {
return !node.role || !NON_ELEMENT_NODE_ROLES.has(node.role.value);
if (node.ignored) {
return false;
}
if (!node.role) {
return false;
}
if (NON_ELEMENT_NODE_ROLES.has(node.role.value)) {
return false;
}
return true;
});
};