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

valueChanged emits twice #12

Open
filipe-nunes opened this issue Feb 23, 2018 · 2 comments
Open

valueChanged emits twice #12

filipe-nunes opened this issue Feb 23, 2018 · 2 comments

Comments

@filipe-nunes
Copy link

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
Copy link

This happens to me too

@kevyaugusto
Copy link

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants