Skip to content

bug(mat-autocomplete): Previous-selected option is still selected even though the value is cleared #26761

Closed
@lhmcn

Description

@lhmcn

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

14.2.7

Description

When an option is selected and then the value is cleared, the option in the dropdown menu is still marked as selected. This is not the same as V14.

Reproduction

Steps to reproduce:

  1. Navigate to the first official example (Highlight the first autocomplete option)
  2. Select "Three"
  3. Clear the value (Three) by pressing backspace

Expected Behavior

No option is selected, as it was in V14 (see picture below)
image

Actual Behavior

The option "Three" is still selected in the dropdown menu (see picture below)
image

Environment

Official demo (V15.2.2)
https://material.angular.io/components/autocomplete/examples

Metadata

Metadata

Assignees

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