diff --git a/projects/angular-material-extensions/select-country/src/lib/mat-select-country.component.spec.ts b/projects/angular-material-extensions/select-country/src/lib/mat-select-country.component.spec.ts index e8cd8aa..c2d3515 100644 --- a/projects/angular-material-extensions/select-country/src/lib/mat-select-country.component.spec.ts +++ b/projects/angular-material-extensions/select-country/src/lib/mat-select-country.component.spec.ts @@ -93,7 +93,7 @@ describe('SelectCountryComponent', () => { country: new SimpleChange(undefined, 'de', true) }); - await fixture.whenStable(); + fixture.detectChanges(); expect(inputElement.value).toMatch('Germany'); }); diff --git a/projects/angular-material-extensions/select-country/src/lib/mat-select-country.component.ts b/projects/angular-material-extensions/select-country/src/lib/mat-select-country.component.ts index 5a5fe07..127e202 100644 --- a/projects/angular-material-extensions/select-country/src/lib/mat-select-country.component.ts +++ b/projects/angular-material-extensions/select-country/src/lib/mat-select-country.component.ts @@ -101,7 +101,7 @@ export class MatSelectCountryComponent implements OnInit, OnChanges, ControlValu } onBlur() { - if (this.value || !this.nullable) { + if (this.countryFormControl.value || !this.nullable) { this.countryFormControl.setValue( this.value ? this.value.name : '' );