+
+ search
-
-
-
- @for (option of options(); track option) {
-
- {{ option }}
-
+
+
+
-
-
-
-
-
Highlight mode: Options are highlighted as you navigate with arrow keys, but the input only updates when you press Enter or click.
- @if (searchString()) {
-
Current value: {{ searchString() }}
- }
+
diff --git a/adev/src/content/examples/aria/autocomplete/src/highlight/app/app.component.ts b/adev/src/content/examples/aria/autocomplete/src/highlight/app/app.component.ts
index b24cd4477dc..145d6655968 100644
--- a/adev/src/content/examples/aria/autocomplete/src/highlight/app/app.component.ts
+++ b/adev/src/content/examples/aria/autocomplete/src/highlight/app/app.component.ts
@@ -1,108 +1,261 @@
import {Combobox, ComboboxInput, ComboboxPopupContainer} from '@angular/aria/combobox';
import {Listbox, Option} from '@angular/aria/listbox';
+import {OverlayModule} from '@angular/cdk/overlay';
import {
afterRenderEffect,
ChangeDetectionStrategy,
Component,
computed,
- ElementRef,
signal,
viewChild,
+ viewChildren,
} from '@angular/core';
+import {FormsModule} from '@angular/forms';
@Component({
selector: 'app-root',
templateUrl: 'app.component.html',
styleUrl: 'app.component.css',
- imports: [Combobox, ComboboxInput, ComboboxPopupContainer, Listbox, Option],
+ imports: [
+ Combobox,
+ ComboboxInput,
+ ComboboxPopupContainer,
+ Listbox,
+ Option,
+ OverlayModule,
+ FormsModule,
+ ],
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class App {
- popover = viewChild
('popover');
- listbox = viewChild>(Listbox);
- combobox = viewChild>(Combobox);
+ /** The combobox listbox popup. */
+ listbox = viewChild>(Listbox);
- searchString = signal('');
+ /** The options available in the listbox. */
+ options = viewChildren