Skip to content

Commit

Permalink
Fixed #15873 - Listbox | p-listbox triggers onChange multiple times
Browse files Browse the repository at this point in the history
  • Loading branch information
mehmetcetin01140 committed Jun 25, 2024
1 parent 1a7c2cf commit ef712b7
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions src/app/components/listbox/listbox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -667,13 +667,7 @@ export class Listbox implements AfterContentInit, OnInit, ControlValueAccessor,
return this._filterValue() ? this.filterService.filter(options, this.searchFields, this._filterValue(), this.filterMatchMode, this.filterLocale) : options;
});

constructor(
public el: ElementRef,
public cd: ChangeDetectorRef,
public filterService: FilterService,
public config: PrimeNGConfig,
private renderer: Renderer2
) {}
constructor(public el: ElementRef, public cd: ChangeDetectorRef, public filterService: FilterService, public config: PrimeNGConfig, private renderer: Renderer2) {}

ngOnInit() {
this.id = this.id || UniqueComponentId();
Expand Down Expand Up @@ -887,7 +881,6 @@ export class Listbox implements AfterContentInit, OnInit, ControlValueAccessor,
.map((option) => this.getOptionValue(option));

this.updateModel(value, event);
this.onChange.emit({ originalEvent: event, value: this.value });
}

event.preventDefault();
Expand Down

0 comments on commit ef712b7

Please sign in to comment.