Skip to content

bug(select[matNativeControl]): Sometimes the options are not triggered #27682

Open
@br-kwon

Description

@br-kwon

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

prior to mdc migration

Description

when using select[matNativeControl] inside <mat-form-field appearance="outline"> there's a couple of problems:

  1. when using an empty string as the default option, the label appears within the form field. directly clicking the label does not trigger the options.
  2. clicking just inside mat-form-field (inside the outline) also does not trigger the options

Reproduction

StackBlitz link: https://stackblitz.com/edit/components-issue-r49x2i?file=src%2Fapp%2Fexample-component.html
Steps to reproduce:

  1. click the label while it's within the form field
  2. also click just inside the bounds of the form field

Expected Behavior

triggers the options

Actual Behavior

options are not triggered - label just moves up

Environment

  • Angular: 16.1.2
  • CDK/Material: 16.1.3
  • Browser(s): chrome
  • Operating System (e.g. Windows, macOS, Ubuntu): macOS

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2The issue is important to a large percentage of users, with a workaroundarea: material/select

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions