mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
* docs(focus): Add docs for regions #8082 * docs(a11y): add more desc for focus trap
This commit is contained in:
@@ -68,6 +68,22 @@ This directive is declared in `A11yModule`.
|
||||
This directive will not prevent focus from moving out of the trapped region due to mouse
|
||||
interaction.
|
||||
|
||||
#### Regions
|
||||
Regions can be declared explicitly with an initial focus element by using
|
||||
the `cdkFocusRegionStart`, `cdkFocusRegionEnd` and `cdkFocusInitial` DOM attributes.
|
||||
`cdkFocusInitial` specifies the element that will receive focus upon initialization of the region.
|
||||
`cdkFocusRegionStart` and `cdkFocusRegionEnd` define the region within which focus will be
|
||||
trapped. When using the tab key, focus will move through this region and wrap around on either end.
|
||||
|
||||
For example:
|
||||
|
||||
```html
|
||||
<a mat-list-item routerLink cdkFocusRegionStart>Focus region start</a>
|
||||
<a mat-list-item routerLink>Link</a>
|
||||
<a mat-list-item routerLink cdkFocusInitial>Initially focused</a>
|
||||
<a mat-list-item routerLink cdkFocusRegionEnd>Focus region end</a>
|
||||
```
|
||||
|
||||
|
||||
### InteractivityChecker
|
||||
`InteractivityChecker` is used to check the interactivity of an element, capturing disabled,
|
||||
|
||||
Reference in New Issue
Block a user