Skip to content

mat-checkbox: Element matching '[cdkFocusInitial]' is not focusable. #15098

Closed
@swftvsn

Description

@swftvsn

What is the expected behavior?

Hi, I have a <mat-checkbox > that I'd like to autofocus inside a dialog. For this I'm using <mat-checkbox cdkFocusInitial ...>

What is the current behavior?

mat-checkbox does not receive focus, and the console contains a warning "Element matching '[cdkFocusInitial]' is not focusable."

What are the steps to reproduce?

https://stackblitz.com/edit/angular-material2-issue-vmf92a

For some reason the stackblitz does not log the error to console, it only silently fails to set the initial focus.

Which versions of Angular, Material, OS, TypeScript, browsers are affected?

Angular 7.2.3, Material 7.3.1, MacOS Mojave, ts 3.2.4, chrome.

Is there anything else we should know?

Keep up the good work!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions