Yes, there's a way we can do that,
<input [matAutocomplete]="auto" matInput (focusout)="onFocusOut()" [formControl]="autoInput">
<mat-autocomplete #auto="matAutocomplete">
<mat-option *ngFor="let number of numbers" [value]="number">
{{number}}
</mat-option>
</mat-autocomplete>
here is the code, I have added a formControl to bind autoComplete value to a variable.
And here is the way, we can access the matInput value after matInput is focused out, then we can perform some operations like autoSelect a value or filter options, etc. to manipulate autocomplete input value.
// since focusout will be called after optionSelected event called of
// matAutoComplete, we are adding timeOut to delay focusOut operations
// and so we will have the true value of autoInput
onFocusOut() {
setTimeout(() => {
let input = this.autoInput.value;
// filtering matching values from options and
// selecting first matched or set the default value
let matchingOption = this._filter(input)[0] || 'DEFAULT VALUE';
// now set the best matching option
// or let's call it autoSelects best match option for an user
this.autoInput.setValue(matchingOption);
}, 300);
}
This way, we will be able to manipulate autocomplete input value on matInput focused out.
Thank you.