`getByRole` doesn't respect `inert` when searching with `hidden: true` · Issue #665 · testing-library/jest-dom · GitHub
More Web Proxy on the site http://driver.im/
You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Elements with the inert attribute set should not be in the accessibility tree, as per the HTML standard.
Inert nodes generally cannot be focused, and user agents do not expose the inert nodes to accessibility APIs or assistive technologies.
Suggested solution:
TBD
The text was updated successfully, but these errors were encountered:
imaspen
changed the title
getByRole doesn't respect inert when searching with hidden: truegetByRole doesn't respect inert when searching with hidden: trueMar 11, 2025
@testing-library/jest-dom
version: 6.6.3node
version: 22.14.0vitest
version: 3.0.8yarn
version: 4.7.0Relevant code or config:
What you did:
Testing for an element not to be in the accessibility tree based on the presence of the inert attribute.
What happened:
getByRole
returned the element, even though it should be hidden from the accessibility tree.Reproduction:
https://codesandbox.io/p/devbox/react-testing-library-demo-forked-tg8knk
Problem description:
Elements with the inert attribute set should not be in the accessibility tree, as per the HTML standard.
Suggested solution:
TBD
The text was updated successfully, but these errors were encountered: