From c1b2347d57b08e87e84f113bb9b7efa53a3158d0 Mon Sep 17 00:00:00 2001 From: crisbeto Date: Sun, 7 Jun 2020 12:29:34 +0200 Subject: [PATCH] docs(a11y): add note about cdkFocusInitial inside focus trap directive Adds a note to the docs mentioning that `cdkFocusInitial` won't do anything inside the focus trap directive, unless `cdkTrapFocusAutoCapture` is enabled. Fixes #19475. --- src/cdk/a11y/a11y.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/cdk/a11y/a11y.md b/src/cdk/a11y/a11y.md index 6abe41a3f264..c2893b95850b 100644 --- a/src/cdk/a11y/a11y.md +++ b/src/cdk/a11y/a11y.md @@ -84,6 +84,9 @@ For example: Focus region end ``` +**Note:** If you're using `cdkFocusInitial` together with the `CdkTrapFocus` directive, nothing +will happen unless you've enabled the `cdkTrapFocusAutoCapture` option as well. This is due to +`CdkTrapFocus` not capturing focus on initialization by default. ## InteractivityChecker `InteractivityChecker` is used to check the interactivity of an element, capturing disabled,