UI: fixed country autocomplete and zip error message

This commit is contained in:
rusikv 2024-09-13 11:41:01 +03:00
parent 6e76509619
commit 278124746c
2 changed files with 5 additions and 5 deletions

View File

@ -20,22 +20,22 @@
formControlName="country"
(selectCountryCode)="changeCountry($event)">
</tb-country-autocomplete>
<div fxLayout.gt-sm="row" fxLayoutGap.gt-sm="10px">
<mat-form-field class="mat-block">
<div class="tb-form-row column-xs tb-standard-fields no-border no-padding">
<mat-form-field class="flex">
<mat-label translate>contact.city</mat-label>
<input matInput formControlName="city">
<mat-error *ngIf="parentForm.get('city').hasError('maxlength')">
{{ 'contact.city-max-length' | translate }}
</mat-error>
</mat-form-field>
<mat-form-field class="mat-block">
<mat-form-field class="flex">
<mat-label translate>contact.state</mat-label>
<input matInput formControlName="state">
<mat-error *ngIf="parentForm.get('state').hasError('maxlength')">
{{ 'contact.state-max-length' | translate }}
</mat-error>
</mat-form-field>
<mat-form-field class="mat-block">
<mat-form-field class="flex">
<mat-label translate>contact.postal-code</mat-label>
<input matInput formControlName="zip">
<mat-error *ngIf="parentForm.get('zip').hasError('pattern')">

View File

@ -200,7 +200,7 @@ export class CountryAutocompleteComponent implements OnInit, ControlValueAccesso
private updateView(value: Country | null) {
if (this.modelValue?.name !== value?.name) {
this.modelValue = value;
this.propagateChange(this.modelValue);
this.propagateChange(this.modelValue?.name);
if (value) {
this.selectCountryCode.emit(value.iso2);
}