Skip to content

bug(Autocomplete): matAutocomplete with control initial value does not highlight value in options with check icon #29422

Open
@kupchic

Description

@kupchic

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

A MatAutocomplete field initialized with a control value does not highlight item in options

Reproduction

StackBlitz link: https://stackblitz.com/edit/saqfud?file=src%2Fexample%2Fautocomplete-filter-example.ts,src%2Fexample%2Fautocomplete-filter-example.html,src%2Fexample%2Fautocomplete-filter-example.css
Steps to reproduce:

  1. Set initial value of control (second one value for example)
   options: string[] = ['One', 'Two', 'Three'];
  myControl = new FormControl(this.options[1]);
  1. click on input on UI

Expected Behavior

Second one option is highlighted
image

Actual Behavior

second option is not highlighted
image

Environment

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgentarea: material/autocomplete

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions