Use setTimeout0 to defer setting Count til element is fully shown for now#270825
Merged
Conversation
… now This is a workaround for now for an accessibility bug that should be addressed. The way that the checked count works is that it's a `CountBadge` widget wrapped in an `aria-live` that reports when the text content (aka the number) changes. However, when the QuickPick is initially shown to the user, the resolved count is done so before actually made visible... `aria-live` does not read out anything that is changed when hidden. I think a proper change here would be to have a separate `aria-live` element that is always off screen (so "technically" visible)... that can be updated when a Count is made visible... but this small fix is fine to at least give screen reader users a count. Fixes #258617
Contributor
There was a problem hiding this comment.
Pull Request Overview
This pull request implements a temporary workaround for an accessibility issue where screen readers don't announce the count of checked items in QuickPick dialogs when initially shown. The fix defers the count update until the element is fully visible using setTimeout0.
Key changes:
- Added
setTimeout0wrapper around count setting calls to ensure screen reader accessibility - Applied the workaround in two locations where checked item counts are updated
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
src/vs/platform/quickinput/browser/tree/quickTree.ts |
Added import for setTimeout0 and wrapped initial count setting in setTimeout0 with TODO comment explaining the accessibility workaround |
src/vs/platform/quickinput/browser/quickInputController.ts |
Added setTimeout0 import and wrapped checked count updates in setTimeout0 with TODO comment referencing the accessibility issue |
Tyriar
approved these changes
Oct 10, 2025
pwang347
pushed a commit
that referenced
this pull request
Oct 14, 2025
… now (#270825) This is a workaround for now for an accessibility bug that should be addressed. The way that the checked count works is that it's a `CountBadge` widget wrapped in an `aria-live` that reports when the text content (aka the number) changes. However, when the QuickPick is initially shown to the user, the resolved count is done so before actually made visible... `aria-live` does not read out anything that is changed when hidden. I think a proper change here would be to have a separate `aria-live` element that is always off screen (so "technically" visible)... that can be updated when a Count is made visible... but this small fix is fine to at least give screen reader users a count. Fixes #258617
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
This is a workaround for now for an accessibility bug that should be addressed.
The way that the checked count works is that it's a
CountBadgewidget wrapped in anaria-livethat reports when the text content (aka the number) changes.However, when the QuickPick is initially shown to the user, the resolved count is done so before actually made visible...
aria-livedoes not read out anything that is changed when hidden.I think a proper change here would be to have a separate
aria-liveelement that is always off screen (so "technically" visible)... that can be updated when a Count is made visible... but this small fix is fine to at least give screen reader users a count.Fixes #258617