fix(aria/combobox): Adjust AutoComplete examples to announce no results text#32786
fix(aria/combobox): Adjust AutoComplete examples to announce no results text#32786adolgachev merged 1 commit intoangular:mainfrom
Conversation
|
Deployed dev-app for 3d7e876 to: https://ng-dev-previews-comp--pr-angular-components-32786-dev-i9va9327.web.app Note: As new commits are pushed to this pull request, this link is updated after the preview is rebuilt. |
|
|
||
| <div class="cdk-visually-hidden"[cdkAriaLive]="'polite'"> | ||
| {{countries().length === 0 ? 'No results found' : ''}} | ||
| <div aria-live="polite" class="cdk-visually-hidden" role="status" > |
There was a problem hiding this comment.
role="status" implicitly sets aria-live="polite", so don't need both.
Also curious about why cdkAriaLive didn't work.
There was a problem hiding this comment.
Oh yeah, good catch. That was left-over when I was trying everything to make it work.
I think cdkAriaLive would work with the changes to include the query text as that is the issue with why it doesn't re-announce even when text switches to blank and then back to the text. But it didn't help without so I just took it out as didn't add any value and this is simpler.
89b95cc to
3d7e876
Compare
Text has to be updated to be announced again so included the query string. Also removed cdkAriaLive usage as wasn't helping.
This is just update to example code, but shows a simple way to announce "no results".