hidden-focusable does not consider when elements are made non-focusable with negative tabindex or inert attribute
When aria-hidden is used on an otherwise focusable element, which is also taken out of focus order with a negative tabindex, or is inside an element with inert
attribute (which also removes them from the focus order), the rule reports an error where there is none.
In our case, we use inert attribute on a parent with aria-hidden, but the negative tabindex also seems valid to me.
Reduced test-case
<a href="#" aria-hidden="true" tabindex="-1"> lorem ipsum </a>
<div aria-hidden="true" inert>
<a href="#"> lorem ipsum </a>
</div>
Configuration
{
"rules": {
"hidden-focusable": "error"
}
}
Expected result
I would expect there to be no errors. Especially with the inert attribute, as that disables both mouse and keyboard access to the content.
Actual result
Got errors.
Version
-
html-validate
: 8.15.0