Skip to content

Commit 4e16a07

Browse files
authored
Improve explanation of queryFallbacks
1 parent cd4b543 commit 4e16a07

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

docs/dom-testing-library/api-queries.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -711,7 +711,7 @@ cy.findByRole('dialog').should('exist')
711711

712712
<!--END_DOCUSAURUS_CODE_TABS-->
713713

714-
You may also want to select an element by any role in its fallbacks, rather than the literal value of the `role` attribute. You can use `queryFallbacks: true` to selectively enable this functionality in specific queries.
714+
By default, it's assumed that the first role of each element is supported, so only the first role can be queried. If you need to query an element by any role in its fallbacks instead, you can use `queryFallbacks: true`.
715715

716716
> An element doesn't have multiple roles in a given environment. It has a single one. Multiple roles in the attribute are evaluated from left to right until the environment finds the first role it understands. This is useful when new roles get introduced and you want to start supporting those as well as older environments that don't understand that role (yet).
717717

0 commit comments

Comments
 (0)