File tree Expand file tree Collapse file tree 1 file changed +14
-3
lines changed Expand file tree Collapse file tree 1 file changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -549,11 +549,22 @@ If you set `hidden` to `true` elements that are normally excluded from the
549
549
accessibility tree are considered for the query as well. The default behavior
550
550
follows https://www.w3.org/TR/wai-aria-1.2/#tree_exclusion with the exception of
551
551
` role="none" ` and ` role="presentation" ` which are considered in the query in any
552
- case.
552
+ case. For example in
553
553
554
554
``` html
555
- <div role =" dialog" >...</div >
556
- ```
555
+ <body >
556
+ <main aria-hidden =" true" >
557
+ <button >Open dialog</button >
558
+ </main >
559
+ <div role =" dialog" >
560
+ <button >Close dialog</button >
561
+ </div >
562
+ </body >
563
+ ```
564
+
565
+ ` getByRole('button') ` would only return the ` Close dialog ` -button. To make
566
+ assertions about the ` Open dialog ` -button you would need to use
567
+ ` getAllByRole('button', { hidden: true }) ` .
557
568
558
569
<!-- DOCUSAURUS_CODE_TABS-->
559
570
You can’t perform that action at this time.
0 commit comments