-
Couldn't load subscription status.
- Fork 411
Open
Description
@testing-library/jest-domversion: 6.6.3nodeversion: 22.14.0vitestversion: 3.0.8yarnversion: 4.7.0
Relevant code or config:
<div role="region" aria-label="inert demo" inert></div>expect(
queryByRole("region", { name: "inert demo", hidden: false })
).not.toBeInTheDocument();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.
Inert nodes generally cannot be focused, and user agents do not expose the inert nodes to accessibility APIs or assistive technologies.
Suggested solution:
TBD
Metadata
Metadata
Assignees
Labels
No labels