Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 8 additions & 12 deletions packages/blockly/core/workspace_svg.ts
Original file line number Diff line number Diff line change
Expand Up @@ -745,17 +745,6 @@ export class WorkspaceSvg
* Updates the label on the workspace to reflect the number of top-level stacks in the workspace.
*/
private updateAriaLabel() {
if (userAgent.APPLE) {
// VoiceOver is reading this label inappropriately, so don't show the
// stack count because it might be inaccurate.
// https://github.com/RaspberryPiFoundation/blockly/issues/9885
aria.setState(
this.svgGroup_,
aria.State.LABEL,
Msg['WORKSPACE_LABEL_PLAIN'],
);
return;
}
const numStacks = this.getTopBlocks(false).length;
if (numStacks == 1) {
aria.setState(
Expand Down Expand Up @@ -2975,7 +2964,14 @@ export class WorkspaceSvg
onTreeFocus(
_node: IFocusableNode,
_previousTree: IFocusableTree | null,
): void {}
): void {
// Screen readers read this label as the enclosing region when workspace
// contents are focused, so refresh it here to keep the stack count from
// going stale.
if (!this.isFlyout && !this.isMutator) {
this.updateAriaLabel();
}
}

/** See IFocusableTree.onTreeBlur. */
onTreeBlur(nextTree: IFocusableTree | null): void {
Expand Down
Loading