Skip to content

Commit

Permalink
Prioritize aria names over hidden in byRole queries
Browse files Browse the repository at this point in the history
  • Loading branch information
kevin940726 committed Oct 24, 2021
1 parent b6b9b5b commit a361d1b
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/queries/role.js
Original file line number Diff line number Diff line change
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 a361d1b

Please sign in to comment.