fix: Block labels should not use custom input labels (#9886)

This commit is contained in:
Michael Harvey
2026-05-18 11:14:46 -04:00
committed by GitHub
parent 4771cd473b
commit dd91830d72
2 changed files with 13 additions and 1 deletions
+1 -1
View File
@@ -2021,7 +2021,7 @@ export class BlockSvg
aria.setState(
this.getFocusableElement(),
aria.State.LABEL,
computeAriaLabel(this),
this.getAriaLabel(aria.Verbosity.STANDARD),
);
configureAriaRole(this);
}
+12
View File
@@ -504,6 +504,18 @@ suite('ARIA', function () {
assert.notInclude(label, 'input');
});
test('Blocks with custom input labels are properly labeled', function () {
const block = this.makeBlock('logic_negate');
const input = block.getInput('BOOL');
input.setAriaLabelProvider('condition');
const label = Blockly.utils.aria.getState(
block.getFocusableElement(),
Blockly.utils.aria.State.LABEL,
);
assert.include(label, 'not');
assert.notInclude(label, 'condition');
});
test('Blocks with one input are properly labeled', function () {
const block = this.makeBlock('logic_negate');
const label = Blockly.utils.aria.getState(