Skip to content

bug(Autocomplete): Selected option is not deselected when first input is removed while panel is closed (without clicking on input field for focus) #31229

Open
@Aisrah

Description

@Aisrah

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

Selected option does not get deselected when the input is cleared (without clicking on input field for focus) while the panel is closed.

Screen.Recording.2025-05-27.at.2.03.36.PM.mov

Reproduction

StackBlitz link:
Steps to reproduce:

  1. Click on autocomplete input field.
  2. Select an option from the list.
  3. Hit backspace from keyboard. (NOTE - don't click on the input to focus the field so that the panel remains closed while hitting backspace)
  4. On first backspace - the selection (checkmark) remains on the previously selected option and the panel gets opened.
  5. On second backspace - the selection gets cleared because panel was already open.

Expected Behavior

The selection should get cleared since the input value has changed.

Actual Behavior

The selection does not get cleared.

Environment

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    P4A relatively minor issue that is not relevant to core functionsarea: material/autocomplete

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions