Skip to content

bug(Dialog): Dialog loses focus when it doesn't contain any focusable elements #33622

Description

@sciambalala

Is this a regression?

  • Yes, this behavior used to work in the previous version

The previous version in which this bug was not present was

No response

Description

Tab and Shift + Tab move focus outside the dialog when there are no focusable elements inside it.

Reproduction

StackBlitz link: https://stackblitz.com/edit/3l8tbmvh?file=src%2Fexample%2Fcdk-dialog-data-example.ts
Steps to reproduce:

  1. Navigate to the "Open dialog" button with the keyboard and press Enter.
  2. Press either Tab or Shift + Tab.

Expected Behavior

Tab and Shift + Tab do not move focus outside the dialog.

Actual Behavior

Tab and Shift + Tab move focus outside the dialog.

Environment

  • Angular: v22
  • CDK/Material: v22
  • Browser(s): any
  • Operating System (e.g. Windows, macOS, Ubuntu): any

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgentarea: cdk/dialoggemini-triagedLabel noting that an issue has been triaged by gemini

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions