I have combined mat-chips autocomplete and input (as both are present in the example section in the docs), but it creates a problem, when I type in part of an Autocomplete Option to filter the options, and then click it, it adds the input value plus the clicked item to the chip list. which is probably a very logcial thing for it to do, since i dont see any reason why it should ignore the blur event if the item was clicked, is there a built-in way / hack to work around this? here is my code:
<mat-form-field class="chip-list">
<mat-chip-list #chipList aria-label="Op selection" class="mat-chip-list-stacked">
<mat-basic-chip *ngFor="let sop of selectedOps" [selectable]="selectable"
[removable]="removable" (removed)="remove(sop)">
<mat-icon matChipRemove *ngIf="removable">cancel</mat-icon>
{{sop.val}}
</mat-basic-chip>
</mat-chip-list>
<div style="position: relative;">
<input matInput [formControl]="chipControl" aria-label="subcats" #SelectInput
[matAutocomplete]="auto" [matChipInputFor]="chipList"
[matChipInputSeparatorKeyCodes]="separatorKeysCodes"
(matChipInputTokenEnd)="add($event)" [matChipInputAddOnBlur]="addOnBlur">
<mat-icon class="icon" (click)="SelectInput.focus()">keyboard_arrow_down</mat-icon>
</div>
<mat-autocomplete #auto="matAutocomplete">
<mat-option *ngFor="let op of filteredOps | async" [value]="op">
<div (click)="optionClicked($event, op)">
<mat-checkbox [checked]="op.selected" (change)="toggleSelection(op)"
(click)="$event.stopPropagation(); ">
{{ op.val }}
</mat-checkbox>
</div>
</mat-option>
</mat-autocomplete>
</mat-form-field>
was I doing something wrong? or is it not ment to work together in the first place? thanks for any feedback!