Skip to content

Commit 82a51f3

Browse files
authored
fix(aria/combobox): Add announcement for empty results to autocomplete demo (#32707)
1 parent 34bcffb commit 82a51f3

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

src/components-examples/aria/autocomplete/autocomplete-auto-select/autocomplete-auto-select-example.html

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@
1717
</button>
1818
</div>
1919

20+
<div class="cdk-visually-hidden"[cdkAriaLive]="'polite'">
21+
{{countries().length === 0 ? 'No results found' : ''}}
22+
</div>
23+
2024
<ng-template ngComboboxPopupContainer>
2125
<ng-template
2226
[cdkConnectedOverlay]="{origin, usePopover: 'inline', matchWidth: true}"

src/components-examples/aria/autocomplete/autocomplete-auto-select/autocomplete-auto-select-example.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import {
2323
viewChildren,
2424
} from '@angular/core';
2525
import {COUNTRIES} from '../countries';
26+
import {CdkAriaLive} from '@angular/cdk/a11y';
2627
import {OverlayModule} from '@angular/cdk/overlay';
2728
import {FormsModule} from '@angular/forms';
2829

@@ -32,6 +33,7 @@ import {FormsModule} from '@angular/forms';
3233
templateUrl: 'autocomplete-auto-select-example.html',
3334
styleUrl: '../autocomplete.css',
3435
imports: [
36+
CdkAriaLive,
3537
Combobox,
3638
ComboboxInput,
3739
ComboboxPopup,

0 commit comments

Comments
 (0)