i am having a input box with mat-autocomplete. there is a search button that i hit to get the matching entries to populate the suggestions. Though overall it works but the behavior is bit annoying. This is what happens:
- I type ra and hit enter.
- after while the progress indicator returns and i see no other visual changes.
if i hit down or right arrow etc i see no suggestions
if i delete the last character then it shows the suggestions.
the ui code looks like:
<div fxLayout="row" fxLayoutAlign="start center">
<div>
<form >
<mat-form-field >
<input type="text" placeholder="Opportunity name" aria-label="Number" matInput [formControl]="myControl" [matAutocomplete]="auto">
<mat-autocomplete #auto="matAutocomplete" [displayWith]="displayFn">
<mat-option *ngFor="let option of filteredOptions | async" [value]="option">
{{ option.name }}
</mat-option>
</mat-autocomplete>
</mat-form-field>
</form>
</div>
<div> <mat-icon (click)="refreshOptyList()">search</mat-icon>
</div>
</div>
the refreshOptyList function is as follow:
refreshOptyList(){
this.diaRef = this.dialog.open(MessageDialogComponent, {
width: '250px',
disableClose: true,
data: { "message": "Please wait...", "showProgress": true }
});
this.revSvc.getOptyList(this.keyword).then(
(val:any) => {
this.diaRef.close()
this.optyArr = JSON.parse(val._body).items;
for(let op of this.optyArr){
this.options.push(new Opty(op.Name, op.OptyNumber))
}
}
)
}