muhammadarsal / ng-select2

Angular 4 wrapper for jQuery select2
7 stars 39 forks source link

valueChanged emits twice #12

Open filipe-nunes opened 6 years ago

filipe-nunes commented 6 years ago

When selecting a new value on the select, the valueChanged event is emitted twice: One time on the ngAfterViewInit() via this.element.on('select2:select select2:unselect', (e: any) => {...} The other on the ngOnChanges(changes: SimpleChanges) via if (changes['value'] && changes['value'].previousValue !== changes['value'].currentValue) {...}

savernike commented 2 years ago

This happens to me too

kevyaugusto commented 2 years ago

It is occurring in my project as well. Has anyone found a solution to that? Or have you replaced the ng-select2 to another similar component?