-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
2352: Announce number of search results to a screen reader #3006
base: main
Are you sure you want to change the base?
Conversation
Suggestions:
|
There are two situations here:
So, all in all, I would say that a manual debounce function wouldn't help in this case.
Good idea, I'll open a design ticket for it. We currently don't show the number of results there at all 😅 |
Turns out we do show the number of results there, it's just not on production yet. I'll add the feedback for screen readers in this ticket then. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested on android emulator for both the native app and web. Works nicely, well done.
Sadly I was not able to get the project running on ios/mac.
@@ -76,7 +83,9 @@ const CitySelector = ({ cities, navigateToDashboard }: CitySelectorProps): React | |||
<CityGroup>{t('nearbyCities')}</CityGroup> | |||
<NearbyCities cities={cities} navigateToDashboard={navigateToDashboard} filterText={filterText} /> | |||
</CityGroupContainer> | |||
<SearchCounter>{t('search:searchResultsCount', { count: resultCities.length })}</SearchCounter> | |||
<SearchCounter accessibilityLiveRegion={resultCities.length === 0 ? 'assertive' : 'polite'}> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❓ I did not experience any difference between assertive and polite, both was immediately read after the currently typed letter. 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting. I thought I did but I might have been imagining it. According to https://developer.android.com/reference/kotlin/androidx/compose/ui/semantics/LiveRegionMode, the main difference is that an assertive live region should also interrupt ongoing speech and a polite one shouldn't. Maybe it's because there was no ongoing speech at the moment? Nothing reading out the key that you had tapped or something?
Short description
This announces the number of search results to screen readers.
Proposed changes
I had to do quite some research for this PR so if you want to follow along, I'll add some sources.
Side effects
Testing
To test on an iOS device (it has to be a real device, VoiceOver doesn't work on emulators):
To test on an Android device:
Resolved issues
Fixes: #2352