fix: Keep workspace stack count fresh instead of hiding it on Mac/VoiceOver#10033
Open
microbit-matt-hillsdon wants to merge 1 commit into
Open
Conversation
…aspberryPiFoundation#9885) Screen readers read the workspace's region label when its contents are focused, but updateAriaLabel only ran on the workspace node's own focus. When a child block took focus on first entry the label was never refreshed, so a stale stack count (e.g. "0 stacks") was announced. The previous workaround dropped the count entirely on Apple. Refresh the label in onTreeFocus, which fires whenever focus enters the workspace tree (including via a child), before the element is focused, so the announced count is current. This lets us restore the informative stack count on all platforms.
1 task
Collaborator
Author
|
This orphans WORKSPACE_LABEL_PLAIN but it seems prudent to keep it around. |
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.
Screen readers read the workspace's region label when its contents are focused, but updateAriaLabel only ran on the workspace node's own focus. When a child block took focus on first entry the label was never refreshed, so a stale stack count (e.g. "0 stacks") was announced. The previous workaround dropped the count entirely on Apple.
Refresh the label in onTreeFocus, which fires whenever focus enters the workspace tree (including via a child), before the element is focused, so the announced count is current. This lets us restore the informative stack count on all platforms.
The basics
The details
Resolves
This fixes only part 1 of this issue as described in this comment #9885 (comment)
Proposed Changes
Refresh the label in onTreeFocus, which fires whenever focus enters the workspace tree (including via a child), before the element is focused, so the announced count is current. This lets us restore the informative stack count on all platforms.
Reason for Changes
This isn't Mac specific, other screen readers also output region context when focusing nodes in the region.
Test Coverage
Documentation
Additional Information