mirror of
https://github.com/google/blockly.git
synced 2026-05-19 18:40:11 +02:00
fix: Update workspace ARIA label on focus (#9841)
This commit is contained in:
@@ -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 {}
|
||||
|
||||
Reference in New Issue
Block a user