I currently have a combo box that allows users to search for existing options by typing inside the box. I want to enhance this functionality by adding a warning whenever a user enters words that do not match any of the options available in the combo box. Below is the code snippet I am working with:
<mat-form-field appearance="outline" class="width-1">
<mat-label>Aircraft Type (ICAO)</mat-label>
<!-- test autocomplete aircraft type -->
<input
type="text"
placeholder="Aircraft Type (ICAO)"
aria-label="Aircraft Type (ICAO)"
matInput
formControlName="aircraftType"
[matAutocomplete]="type"
(input)="onAircraftTypeChange()"
/>
<mat-autocomplete
#type="matAutocomplete"
(optionSelected)="onSelectAircraftType($event.option.value)"
[displayWith]="displayAircraftTypeFn"
>
<mat-option
*ngFor="let type of filteredAircraftTypes | async"
[value]="type"
>
{{ type.label }}
</mat-option>
</mat-autocomplete>
<!-- end test autocomplete -->
</mat-form-field>
https://i.sstatic.net/Kaqp6.png
I aim to display the warning message above the form field.