-
-
Notifications
You must be signed in to change notification settings - Fork 902
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
Two ng-select elements bound to same form control are not in sync #1791
Comments
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions 🎆 |
No solution for this yet, had to work around it by patching the value to the formControl manually in a change event. Really annoying, but oh well. |
It works as expected, you can confirm that replacing it with simple selects and you will get identical behaviour: <select
(ngModelChange)="showConfirm(confirmation)"
placeholder="Select age"
formControlName="age">
<option *ngFor="let age of ages" [value]="age.value">{{ age.label }}</option>
</select>
<select
(ngModelChange)="showConfirm(confirmation)"
placeholder="Select age"
formControlName="age">
<option *ngFor="let age of ages" [value]="age.value">{{ age.label }}</option>
</select> AFAIK, you can't have controls with the same |
Describe the bug
Given two ng-select elements that are both bound to the same form control (reactive forms)
when the user selects an item in one of the ng-select elements
then I expect the second ng-select element to be updated accordingly.
Reproducbile example
https://stackblitz.com/edit/angular-894pxt
To Reproduce
Steps to reproduce the behavior (if example is not provided):
Expected behavior
Second ng-select shows the same selected entry.
The text was updated successfully, but these errors were encountered: