-
Notifications
You must be signed in to change notification settings - Fork 163
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
feat(combo, simple-combo): filter out non-existent items from selection - master #14772
base: master
Are you sure you want to change the base?
Conversation
projects/igniteui-angular/src/lib/combo/combo.component.spec.ts
Outdated
Show resolved
Hide resolved
projects/igniteui-angular/src/lib/combo/combo.component.spec.ts
Outdated
Show resolved
Hide resolved
projects/igniteui-angular/src/lib/combo/combo.component.spec.ts
Outdated
Show resolved
Hide resolved
projects/igniteui-angular/src/lib/combo/combo.component.spec.ts
Outdated
Show resolved
Hide resolved
projects/igniteui-angular/src/lib/combo/combo.component.spec.ts
Outdated
Show resolved
Hide resolved
projects/igniteui-angular/src/lib/combo/combo.component.spec.ts
Outdated
Show resolved
Hide resolved
projects/igniteui-angular/src/lib/combo/combo.component.spec.ts
Outdated
Show resolved
Hide resolved
projects/igniteui-angular/src/lib/combo/combo.component.spec.ts
Outdated
Show resolved
Hide resolved
projects/igniteui-angular/src/lib/combo/combo.component.spec.ts
Outdated
Show resolved
Hide resolved
Setting the selection via the |
@RivaIvanova @jackofdiamond5 Are you suggesting that the Please let me know if I’ve understood your suggestion correctly or if there’s another approach you’d prefer me to consider. |
You are correct and the <igx-combo
#comboModel
#myComboModel="ngModel"
required
[data]="items"
[(ngModel)]="ngModelValue"
>
<label igxLabel>Fruits</label>
</igx-combo>
combo selection {{ comboModel.selection.length }}
combo valid {{ myComboModel.valid }} public items: any[] = ['Mango', 'Banana', 'Apple'];
public ngModelValue = ['invalid value']; In this case, the combo selection is 0, and nothing is displayed in the read-only input field, which is correct according to the new changes. However, the controls If the custom The same is true if we have a combo inside a reactive form. <form [formGroup]="user">
<igx-combo
[data]="genres"
formControlName="genres"
>
<label igxLabel>Movies</label>
</igx-combo>
</form>
reactive form valid {{ user.valid }} public user: UntypedFormGroup;
public genres: any[] = ['Action', 'Comedy', 'Adventure'];
constructor(fb: UntypedFormBuilder) {
this.user = fb.group({
genres: [['test'], Validators.required],
});
} If we set Here is a sample that demonstrates the configuration. Also, this enhancement aligns the Angular combo with the WC one, which is great, but this should be addressed for the simple combo as well. 🙂 |
…into ganastasov/feat-14732-master
…into ganastasov/feat-14732-master
Closes #14732
Additional information (check all that apply):
Checklist:
feature/README.MD
updates for the feature docsREADME.MD
CHANGELOG.MD
updates for newly added functionalityng update
migrations for the breaking changes (migrations guidelines)