This change causes the screen reader to announce the outcome of your search query while your type, to provide convenience for screen reader users. You could consider this a pragmatic typeahead implementation.
Because aria-live="polite" is used it is announced after you performed a keystroke.
Good to know:
I also applied aria-liveto the <ErrorPage> so that title is also announced. Adding this also made me realize it can also be beneficial in other cases where ErrorPage get rendered.
I needed to prevent the announcement of placeholder data while you type. I did that by applying two isFetching-conditions. Though, I think it's more logical to render the placeholder data based on the isFetching-state itself instead of !!query. Something to improve in the future.
This change is based on feedback we got from our internal accessibility auditor. He noted the following:
Visually Impaired Home Screen reader does not automatically announce the typeahead search results. Screen reader should automatically announce the typeahead search results.
This change causes the screen reader to announce the outcome of your search query while your type, to provide convenience for screen reader users. You could consider this a pragmatic typeahead implementation.
Because
aria-live="polite"
is used it is announced after you performed a keystroke.Good to know:
aria-live
to the<ErrorPage>
so that title is also announced. Adding this also made me realize it can also be beneficial in other cases where ErrorPage get rendered.isFetching
-conditions. Though, I think it's more logical to render the placeholder data based on theisFetching
-state itself instead of!!query
. Something to improve in the future.This change is based on feedback we got from our internal accessibility auditor. He noted the following: