Skip to content

feat(autocomplete): allow configuring requireSelection blur behavior without resetting value to null #32953

@liesahead

Description

@liesahead

Feature Description

Please add a configurable option such as preserving the previous selection on blur, so that requireSelection does not have to emit null unless the application explicitly wants that behavior.

Related issues:

Use Case

In our case, we manually restore the previous selected value when Angular resets the control to null.

That workaround causes multiple valueChanges emissions for a single user interaction: first null, then the previously selected value after we restore it. This is noisy, annoying to handle, and not reliably distinguishable from a real clear action triggered by the user.

We want to detect an actual clear action separately from the case where the user only focuses the input, opens the autocomplete panel, and then blurs without selecting a new option. A configurable behavior here would prevent unnecessary state changes and extra reactive form events.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: material/autocompletefeatureLabel used to distinguish feature request from other issuesgemini-triagedLabel noting that an issue has been triaged by geminineeds triageThis issue needs to be triaged by the team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions