mirror of
https://github.com/google/blockly.git
synced 2026-05-31 00:10:07 +02:00
fix: Block labels should not use custom input labels (#9886)
This commit is contained in:
@@ -2021,7 +2021,7 @@ export class BlockSvg
|
||||
aria.setState(
|
||||
this.getFocusableElement(),
|
||||
aria.State.LABEL,
|
||||
computeAriaLabel(this),
|
||||
this.getAriaLabel(aria.Verbosity.STANDARD),
|
||||
);
|
||||
configureAriaRole(this);
|
||||
}
|
||||
|
||||
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user