Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MultiSelect component triggers two empty change events when rendered #14103

Closed
mher-at-qbeyond opened this issue Nov 13, 2023 · 1 comment
Closed
Assignees
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Milestone

Comments

@mher-at-qbeyond
Copy link

mher-at-qbeyond commented Nov 13, 2023

Describe the bug

If the multiselect is configured with the following properties, it will launch two onChange events with value: null and without originalEvent


    [options]="cities"
    [(ngModel)]="selectedCity"
    [filter]="false"
    optionLabel="name"
    optionValue="code"
    [maxSelectedLabels]="2"
    (onChange)="dropdownChanged($event);"

Environment

Angular: 16.2.7
PrimeNG: 16.7.0
Browser: latest Chrome

Reproducer

https://stackblitz.com/edit/djzi3p-5kiysu?file=src%2Fapp%2Fdemo%2Fmulti-select-basic-demo.ts

Angular version

16.2.7

PrimeNG version

16.7.0

Build / Runtime

Angular CLI App

Language

TypeScript

Node version (for AoT issues node --version)

16.20.2

Browser(s)

No response

Steps to reproduce the behavior

  1. configure multiselect as seen above
  2. after the page is rendered two empty events will be launched on onChange trigger
    

Expected behavior

Should not launch two empty onChange events when rendered.

@mher-at-qbeyond mher-at-qbeyond added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Nov 13, 2023
@cetincakiroglu cetincakiroglu added this to the 16.8.0 milestone Nov 15, 2023
@cetincakiroglu cetincakiroglu added Type: Bug Issue contains a bug related to a specific component. Something about the component is not working and removed Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible labels Nov 15, 2023
@cetincakiroglu cetincakiroglu self-assigned this Nov 15, 2023
@cetincakiroglu
Copy link
Contributor

Hi,

This issue is fixed in 2008537

Thanks a lot for reporting the issue!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Projects
None yet
Development

No branches or pull requests

2 participants