forked from angular/components
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathautocomplete-highlight-example.html
More file actions
40 lines (38 loc) · 1.3 KB
/
autocomplete-highlight-example.html
File metadata and controls
40 lines (38 loc) · 1.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<div ngCombobox filterMode="highlight">
<div #origin class="example-autocomplete">
<span class="example-search-icon material-symbols-outlined" translate="no">search</span>
<input
aria-label="Label dropdown"
placeholder="Select a country"
ngComboboxInput
/>
<button
class="example-clear-button"
aria-label="Clear"
(keydown)="onKeydown($event)"
(click)="clear()"
>
<span aria-hidden="true" class="example-clear-icon material-symbols-outlined">close</span>
</button>
</div>
<ng-template ngComboboxPopupContainer>
<ng-template
[cdkConnectedOverlay]="{origin, usePopover: 'inline', matchWidth: true}"
[cdkConnectedOverlayOpen]="true"
>
<div class="example-popup">
@if (countries().length === 0) {
<div class="example-no-results">No results found</div>
}
<div ngListbox>
@for (country of countries(); track country) {
<div ngOption [value]="country" [label]="country" [disabled]="country === 'Brazil'">
<span class="example-option-label">{{country}}</span>
<span class="example-check-icon material-symbols-outlined" translate="no">check</span>
</div>
}
</div>
</div>
</ng-template>
</ng-template>
</div>