isHiddenFromAccessibility
Also available as isInaccessible()
alias for React Testing Library compatibility.
Checks if given element is hidden from assistive technology, e.g. screen readers.
Like isInaccessible
function from DOM Testing Library this function considers both accessibility elements and presentational elements (regular View
s) to be accessible, unless they are hidden in terms of host platform.
This covers only part of ARIA notion of Accessiblity Tree, as ARIA excludes both hidden and presentational elements from the Accessibility Tree.
For the scope of this function, element is inaccessible when it, or any of its ancestors, meets any of the following conditions:
display: none
stylearia-hidden
prop set to true
accessibilityElementsHidden
prop set to true
importantForAccessibility
prop set to no-hide-descendants
aria-modal
or accessibilityViewIsModal
prop set to true
Specifying accessible={false}
, accessiblityRole="none"
, or importantForAccessibility="no"
props does not cause the element to become inaccessible.