-
Notifications
You must be signed in to change notification settings - Fork 410
Open
Description
@testing-library/jest-dom
version: 6.6.3node
version: 22.14.0vitest
version: 3.0.8yarn
version: 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