Skip to content

mat-form-field: focus is reset when clicking the label #23351

Open
@pbogit

Description

@pbogit

Reproduction

Steps to reproduce:

  1. Go to https://stackblitz.com/edit/angular-gnyjk4?file=src%2Fapp%2Fmaterial-module.ts
  2. Click the form field -> the form field is focused and you can enter text
  3. Click on the label "Input"

Expected Behavior

When clicking the label while the form field is focused, the focus should stay on the text field (behave the same like when clicking the text input itself).

Actual Behavior

The focus is quickly unset and then set again on the text field.
https://user-images.githubusercontent.com/29429581/129170022-8b6585e1-a6de-4397-a94c-0b5234845af3.mp4

Environment

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    P4A relatively minor issue that is not relevant to core functionsarea: material/form-fieldneeds investigationA member of the team needs to do further investigation to determine the root cause

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions