Skip to content

Commit

Permalink
feat: Prioritize accessible names check higher than inaccessibility c…
Browse files Browse the repository at this point in the history
…heck in `byRole` queries (#1068)

Co-authored-by: eps1lon <silbermann.sebastian@gmail.com>
  • Loading branch information
kevin940726 and eps1lon committed Nov 3, 2021
1 parent b6b9b5b commit 2866544
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/queries/role.js
Expand Up @@ -153,13 +153,6 @@ function queryAllByRole(
// don't care if aria attributes are unspecified
return true
})
.filter(element => {
return hidden === false
? isInaccessible(element, {
isSubtreeInaccessible: cachedIsSubtreeInaccessible,
}) === false
: true
})
.filter(element => {
if (name === undefined) {
// Don't care
Expand All @@ -176,6 +169,13 @@ function queryAllByRole(
text => text,
)
})
.filter(element => {
return hidden === false
? isInaccessible(element, {
isSubtreeInaccessible: cachedIsSubtreeInaccessible,
}) === false
: true
})
}

function makeRoleSelector(role, exact, customNormalizer) {
Expand Down

0 comments on commit 2866544

Please sign in to comment.