diff --git a/packages/blockly/core/block_svg.ts b/packages/blockly/core/block_svg.ts index 0f3d385d0..0847333bd 100644 --- a/packages/blockly/core/block_svg.ts +++ b/packages/blockly/core/block_svg.ts @@ -2021,7 +2021,7 @@ export class BlockSvg aria.setState( this.getFocusableElement(), aria.State.LABEL, - computeAriaLabel(this), + this.getAriaLabel(aria.Verbosity.STANDARD), ); configureAriaRole(this); } diff --git a/packages/blockly/tests/mocha/aria_test.js b/packages/blockly/tests/mocha/aria_test.js index bd5ee02cf..11c20be31 100644 --- a/packages/blockly/tests/mocha/aria_test.js +++ b/packages/blockly/tests/mocha/aria_test.js @@ -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(