fix(Select): announce result count with the active option for improvedA11y combobox#1152
Merged
Merged
Conversation
|
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1152 +/- ##
==========================================
+ Coverage 84.98% 85.00% +0.01%
==========================================
Files 1230 1230
Lines 21555 21588 +33
Branches 8193 8209 +16
==========================================
+ Hits 18319 18351 +32
- Misses 3150 3151 +1
Partials 86 86 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
f6ed694 to
3156726
Compare
0a25aa9 to
a6a173f
Compare
…dA11y combobox The improvedA11y combobox echoed the active option into the result-count live region and overwrote the count, so screen readers stopped hearing it. Announce the count together with the highlighted option in one polite region (option only on arrow navigation), debounced on open/filter so per-keystroke updates coalesce and do not race the combobox input's own typing echo. On open/filter the seeded option's group label is included too, since VoiceOver does not read it natively there; during arrow navigation the group is left to the native reading. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0127ZbvzW5a888TLW3jTJXWJ
a6a173f to
f759a78
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
SUMMARY:
The
improvedA11ycombobox echoed the highlighted option into the result-count live region, overwriting the count — so screen readers stopped announcing "N matches found" while filtering (regression surfaced after #1149). This combines the count and option in one polite announcement instead.What screen readers now hear (single live region):
"{count} matches found. {option}, {group}, {n} of {total}"— one announcement, including the seeded option's group."{option}, {n} of {total}"— option only; no count (avoids re-announcing it as noise) and no group (VoiceOver reads the option + its group natively while arrowing, so echoing them would double-announce).improvedA11y) Selects are completely unchanged — all of the above is gated behindimprovedA11y.Implementation (minimal delta on #1149):
liveRegionMessagenow appends the option to the count instead of overwriting it, gated by anannounceModeRef('list'on open/filter,'nav'on arrow — set in the seed effect andmoveActiveDescendant).optionId → groupmap memoized onoptions(O(1) lookup, no per-announcement rescan), also gated toimprovedA11y.useEffect+setTimeout(the repo's standard pattern, e.g.Accordion), gated toimprovedA11y; the delay is theANNOUNCE_DEBOUNCE_DURATIONconstant inSelect.types.ts, matching the repo's timing-constant convention (ANIMATION_DURATION, …).ANNOUNCE_DEBOUNCE_DURATION), consistent with the existing ones (ANIMATION_DURATION, …); no new component props, no locale changes.GITHUB ISSUE (Open Source Contributors)
N/A
JIRA TASK (Eightfold Employees Only):
https://eightfoldai.atlassian.net/browse/ENG-203165
Follow-up to the combobox VPAT work in #1149.
CHANGE TYPE:
TEST COVERAGE:
TEST PLAN:
Select.test.tsx: open announces the count andApple, 1 of 3; afterArrowDownthe region announcesBanana, 2 of 3without the count.Apple, With HRIS);ArrowDownannouncesBanana, 2 of 2without the group (left to VoiceOver's native reading).Select.test.tsxsuite passes (81 tests);Formsuite unaffected (theimprovedA11ygate keeps plain Selects untouched).