-
-
Notifications
You must be signed in to change notification settings - Fork 44
Open
Description
Describe the bug
I'm using the the mat-select-country inside a reactive form:
<form [formGroup]="form">
<div formGroupName="companyAddress">
<mat-select-country
[label]="'COUNTRY' | translate"
[placeHolder]="'SELECT_COUNTRY' | translate"
appearance="fill"
[required]="true"
formControlName="country"
[error]="'COUNTRY_INVALID' | translate"
[language]="settingsService.activeLanguage$ | async"
></mat-select-country>
</div>
</form>
<button
mat-flat-button
(click)="submit()"
type="submit"
>
{{ "SUBMIT" | translate }}
</button>form = new FormGroup({
companyAddress: new FormGroup({
country: new FormControl<Country>(undefined),
}),
});
submit() {
if (this.form.invalid) {
return;
}
// form valid
console.log("submitted");
}(Note: the FormGroups are nested because this is a minimal copy of the actual code)
But the following doesn't work:
- the appearance isn't filled (it's outline)
- it has no required marking
- there is no error shown when submitting the form and the form is still valid
The translation change is sometimes triggered during runtime by the user and this is working correctly, so the text are all getting translated.
Expected behavior
- the appearance should be fill
- there should be a required marking
- there should be an error shown when submitting the form and the form should be invalid
Desktop (please complete the following information):
- OS: Win10 22h2
- Browser: Microsoft Edge v120
- Angular: v16
- @angular-material-extensions/select-country: 16.0.0
Metadata
Metadata
Assignees
Labels
No labels
