Skip to content

bug(Autocomplete): Filter + requireSelection does not work #32089

@olfek

Description

@olfek

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

https://material.angular.dev/components/autocomplete/overview#adding-a-custom-filter

... paired with ...

https://material.angular.dev/components/autocomplete/overview#require-an-option-to-be-selected

... does not work because the FormControl value does not change until an option is selected.

Without requireSelection, the FormControl value changes with every input character, therefore the filter works.

My workaround involves using (change) and (input) on the input element to capture the text.

Reproduction

I will provide this later when I have time.

Expected Behavior

N/A

Actual Behavior

N/A

Environment

Angular CLI: 20.1.6
Node: 22.18.0
Package Manager: npm 10.9.3
OS: win32 x64

Angular: 20.1.7
... animations, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, router

Package                      Version
------------------------------------------------------
@angular-devkit/architect    0.2001.6
@angular-devkit/core         20.1.6
@angular-devkit/schematics   20.1.6
@angular/build               20.1.6
@angular/cdk                 20.1.6
@angular/cli                 20.1.6
@angular/material            20.1.6
@schematics/angular          20.1.6
rxjs                         7.8.2
typescript                   5.8.3
webpack                      5.101.2
zone.js                      0.15.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs 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