Skip to content

Commit 5b36bdd

Browse files
crisbetoandrewseguin
authored andcommitted
docs(a11y): add note about cdkFocusInitial inside focus trap directive (#19560)
Adds a note to the docs mentioning that `cdkFocusInitial` won't do anything inside the focus trap directive, unless `cdkTrapFocusAutoCapture` is enabled. Fixes #19475.
1 parent c0f438d commit 5b36bdd

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/cdk/a11y/a11y.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,9 @@ For example:
8484
<a mat-list-item routerLink cdkFocusRegionEnd>Focus region end</a>
8585
```
8686

87+
**Note:** If you're using `cdkFocusInitial` together with the `CdkTrapFocus` directive, nothing
88+
will happen unless you've enabled the `cdkTrapFocusAutoCapture` option as well. This is due to
89+
`CdkTrapFocus` not capturing focus on initialization by default.
8790

8891
## InteractivityChecker
8992
`InteractivityChecker` is used to check the interactivity of an element, capturing disabled,

0 commit comments

Comments
 (0)