bug(bottom-sheet): auto focus defaults to dialog instead of first-tabbable #30483
Labels
area: material/bottom-sheet
P3
An issue that is relevant to core functions, but does not impede progress. Important, but not urgent
Is this a regression?
The previous version in which this bug was not present was
No response
Description
The documentation https://material.angular.io/components/bottom-sheet/overview#focus-management specifies that the default behavior for
autoFocus
isfirst-tabbable
. However, since at least v16, the default behavior has been set todialog
.This is a surprising
autoFocus
behavior from an accessibility standpoint.This even seems to have been enshrined in the tests: https://github.com/angular/components/blob/c1ff40f/src/material/bottom-sheet/bottom-sheet.spec.ts#L620
Reproduction
StackBlitz link: https://stackblitz.com/edit/components-issue-starter-dd7tdtv9?file=src%2Fmain.ts
Steps to reproduce:
Expected Behavior
First tabbable element should receive focus
Actual Behavior
First tabbable element does not receive focus, bottom sheet container receives focus instead.
Environment
The text was updated successfully, but these errors were encountered: