Skip to content

Commit a5f4926

Browse files
committed
docs: clear input field whenever a selection is
made in chips autocomplete example
1 parent 8950ec3 commit a5f4926

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/components-examples/material/chips/chips-autocomplete/chips-autocomplete-example.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@
2121
[matChipInputSeparatorKeyCodes]="separatorKeysCodes"
2222
(matChipInputTokenEnd)="add($event)"
2323
/>
24-
<mat-autocomplete #auto="matAutocomplete" (optionSelected)="selected($event)">
24+
<!-- Clear input value after a selection is made -->
25+
<mat-autocomplete #auto="matAutocomplete" (optionSelected)="selected($event); fruitInput.value = ''">
2526
@for (fruit of filteredFruits(); track fruit) {
2627
<mat-option [value]="fruit">{{fruit}}</mat-option>
2728
}

0 commit comments

Comments
 (0)