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 23, 2021
1 parent 5bc9364 commit aeb7f4a
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 @@ -133,13 +133,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 @@ -156,6 +149,13 @@ function queryAllByRole(
text => text,
)
})
.filter(element => {
return hidden === false
? isInaccessible(element, {
isSubtreeInaccessible: cachedIsSubtreeInaccessible,
}) === false
: true
})
}

const getMultipleError = (c, role, {name} = {}) => {
Expand Down

0 comments on commit aeb7f4a

Please sign in to comment.