0

export class AutocompleteSimpleExample {
  myControl = new FormControl();
  options: string[] = ['One', 'Two', 'Three'];
}
<form class="example-form">
  <mat-form-field class="example-full-width">
    <input type="text" placeholder="Pick one" aria-label="Number" matInput [formControl]="myControl" [matAutocomplete]="auto">
    <mat-autocomplete #auto="matAutocomplete">
      <mat-option *ngFor="let option of options" [value]="option">
        {{option}}
      </mat-option>
    </mat-autocomplete>
  </mat-form-field>
</form>

Problem is when I click on input-box than dropdown-box is open.
But I got, when I click on input-box than not open dropdown box, dropdown box is open when enter in some text only. So how I fix this?

PrakashG
  • 1,642
  • 5
  • 20
  • 30
Bhavesh Ajani
  • 991
  • 9
  • 11
  • The question is a bit unclear, would you mind elaborating this ? – RajuPedda Jun 20 '19 at 07:37
  • possible duplicate of https://stackoverflow.com/questions/56581215/angular-material-autocomplete-onfocus-keep-suggestion-panel-closed/56581724#56581724 – ysf Jun 20 '19 at 08:42
  • the problem is when i click on input field than open option box, but solution is when focus or click on input field than not open option box if input box null – Bhavesh Ajani Jun 20 '19 at 12:00

0 Answers0