Skip to content

Commit 60ce108

Browse files
lukonikmmalerba
andauthored
docs(material/sidenav): Document cdkFocusInitial for sidenav (#19564)
* docs(material/sidenav): Document cdkFocusInitial for sidenav adds documentation about focusing inside the sidenav component Fixes #19450 * cdkFocusInitial sentence rephrased * sidenav autoFocus explained in details * sidenav focus statement rephrased * gramma error fixed * rephrased autoFocus sentence * Update sidenav.md Co-authored-by: mmalerba <[email protected]>
1 parent ebda4de commit 60ce108

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/material/sidenav/sidenav.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,11 @@ Similarly, the `<mat-sidenav-content>` should be given a role based on what it c
209209
represents the primary content of the page, it may make sense to mark it `role="main"`. If no more
210210
specific role makes sense, `role="region"` is again a good fallback.
211211

212+
#### Focus management
213+
The sidenav has the ability to capture focus. This behavior is turned on for the `push` and `over` modes and it is off for `side` mode. You can change its default behavior by the `autoFocus` input.
214+
215+
By default the first tabbable element will recieve focus upon open. If you want a different element to be focused, you can set the `cdkFocusInitial` attribute on it.
216+
212217
### Troubleshooting
213218

214219
#### Error: A drawer was already declared for 'position="..."'

0 commit comments

Comments
 (0)