Skip to content

Commit 9be97e3

Browse files
Merge pull request #15900 from primefaces/issue-15873
Fixed #15873 - Listbox | p-listbox triggers onChange multiple times
2 parents 6bdfff6 + ef712b7 commit 9be97e3

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

src/app/components/listbox/listbox.ts

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -667,13 +667,7 @@ export class Listbox implements AfterContentInit, OnInit, ControlValueAccessor,
667667
return this._filterValue() ? this.filterService.filter(options, this.searchFields, this._filterValue(), this.filterMatchMode, this.filterLocale) : options;
668668
});
669669

670-
constructor(
671-
public el: ElementRef,
672-
public cd: ChangeDetectorRef,
673-
public filterService: FilterService,
674-
public config: PrimeNGConfig,
675-
private renderer: Renderer2
676-
) {}
670+
constructor(public el: ElementRef, public cd: ChangeDetectorRef, public filterService: FilterService, public config: PrimeNGConfig, private renderer: Renderer2) {}
677671

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

889883
this.updateModel(value, event);
890-
this.onChange.emit({ originalEvent: event, value: this.value });
891884
}
892885

893886
event.preventDefault();

0 commit comments

Comments
 (0)