Skip to content

ngModelChange fires twice on mat-chip-listbox #26942

@rst2071

Description

@rst2071

Which @angular/* package(s) are the source of the bug?

Don't known / other

Is this a regression?

No

Description

ngModelChange on the material chip listbox is not only triggered when selecting a value, but also a second time when clicking anywhere in the browser window with the mouse.
The occurs only once and with the first mouse-click after a previous value has been selected. The thereby emitted value is the same as the previous one.
It does not occur when clicking on another chip with the next mouse-click.

Steps to reproduce:

  1. click on a chip to select a value
  2. click somewhere in the window (just not on a chip) to trigger the event a second time

Please provide a link to a minimal reproduction of the bug

https://stackblitz.com/edit/angular-gcasi5?file=src/app/chips-overview-example.ts

Please provide the exception or error you saw

No response

Please provide the environment you discovered this bug in (run ng version)

Angular CLI: 15.2.6
Node: 18.16.0
Package Manager: npm 9.5.1
OS: darwin x64

Angular: 15.2.7
... animations, cdk, common, compiler, compiler-cli, core, forms
... material, material-date-fns-adapter, platform-browser
... platform-browser-dynamic, router, service-worker

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1502.6
@angular-devkit/build-angular   15.2.6
@angular-devkit/core            15.2.6
@angular-devkit/schematics      15.2.6
@angular/cli                    15.2.6
@schematics/angular             15.2.6
rxjs                            7.8.0
typescript                      4.9.5

Anything else?

No response

Metadata

Metadata

Assignees

Labels

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

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions