Skip to content

Component p-listbox triggers onChange multiple times #15873

@FloreaAndrei22

Description

@FloreaAndrei22

Describe the bug

The onChange event emitter is triggered two times when all items are selected.

Selecting a single entry is fine, but when the select all button is clicked, the trigger is duplicated

Environment

"dependencies": {
"@angular-devkit/core": "~17.3.8",
"@angular/animations": "^17.3.10",
"@angular/cdk": "^17.3.10",
"@angular/common": "^17.3.10",
"@angular/compiler": "^17.3.10",
"@angular/core": "^17.3.10",
"@angular/forms": "^17.3.10",
"@angular/platform-browser": "^17.3.10",
"@angular/platform-browser-dynamic": "^17.3.10",
"@angular/router": "^17.3.10",
"@fortawesome/fontawesome-pro": "6.3.0",
"@ng-idle/core": "^14.0.0",
"@stomp/rx-stomp": "^2.0.0",
"@stomp/stompjs": "^7.0.0",
"chart.js": "^4.4.3",
"hammerjs": "^2.0.8",
"karma-coverage": "^2.2.1",
"lodash-es": "^4.17.21",
"moment": "^2.30.1",
"pixi.js": "^7.4.2",
"primeflex": "^3.3.1",
"primeicons": "^7.0.0",
"primeng": "^17.18.1",
"quill": "~1.3.7",
"rxjs": "^7.8.1",
"simplify-js": "^1.2.4",
"ts-gaussian": "^3.0.4",
"tslib": "^2.6.2",
"zone.js": "~0.14.6"
},

Reproducer

https://stackblitz.com/edit/github-krbnal?file=src%2Fapp%2Fapp.component.html,src%2Fapp%2Fapp.component.ts,src%2Fapp%2Fapp.component.spec.ts

Angular version

17.3.10

PrimeNG version

17.18.1

Build / Runtime

Angular CLI App

Language

TypeScript

Node version (for AoT issues node --version)

20.14.0

Browser(s)

No response

Steps to reproduce the behavior

No response

Expected behavior

No response

Metadata

Metadata

Labels

Type: BugIssue contains a bug related to a specific component. Something about the component is not working

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions