Skip to content

docs(focus): Add docs for regions #8082 #8128

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Oct 30, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions src/cdk/a11y/a11y.md
Original file line number Diff line number Diff line change
Expand Up @@ -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>
```

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could be a bit more explicit about what each does:
"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."


### InteractivityChecker
`InteractivityChecker` is used to check the interactivity of an element, capturing disabled,
Expand Down