fix: Update workspace ARIA label on focus (#9841)

This commit is contained in:
Aaron Dodson
2026-05-11 08:09:02 -07:00
committed by GitHub
parent 3d597157d1
commit 4e1bdf62ae
+6 -10
View File
@@ -720,7 +720,7 @@ export class WorkspaceSvg
);
} else {
// Main workspaces get labelled with how many stacks of blocks they contain
// This will be updated in a change listener, but set it here in case there are blocks in the initial state of the workspace
// This will be updated on focus, but set it here in case there are blocks in the initial state of the workspace
this.updateAriaLabel();
}
}
@@ -798,14 +798,6 @@ export class WorkspaceSvg
this.setInitialAriaContext();
if (!this.isFlyout && !this.isMutator) {
// Set up a change listener to update the aria label on main workspace
this.addChangeListener((e) => {
if (e.isUiEvent) return;
this.updateAriaLabel();
});
}
if (!this.isFlyout) {
browserEvents.conditionalBind(
this.svgGroup_,
@@ -2696,7 +2688,11 @@ export class WorkspaceSvg
}
/** See IFocusableNode.onNodeFocus. */
onNodeFocus(): void {}
onNodeFocus(): void {
if (!this.isFlyout && !this.isMutator) {
this.updateAriaLabel();
}
}
/** See IFocusableNode.onNodeBlur. */
onNodeBlur(): void {}