<mat-form-field
  appearance="outline"
  class="mat-form-field custom-label-position"
  floatLabel="auto"
>
  <mat-label>{{ label }}</mat-label>
  <input
    matInput
    [placeholder]="label"
    [matAutocomplete]="auto"
    (focus)="onFocus(trigger)"
    (input)="onInput($event)"
    (blur)="onTouched()"
    [formControl]="searchControl"
    #trigger="matAutocompleteTrigger"
  />

  <mat-autocomplete
    #auto="matAutocomplete"
    [displayWith]="displayFn"
    (optionSelected)="onOptionSelected($event)"
  >
    <mat-option
      *ngFor="let option of filteredOptions$ | async"
      [value]="option"
    >
      {{ option.label }}
    </mat-option>
  </mat-autocomplete>
</mat-form-field>
