mirror of
https://github.com/google/blockly.git
synced 2026-01-08 01:20:12 +01:00
fix: Don't include count of inputs in block ARIA label (#9502)
* fix: Don't include count of inputs in block ARIA label * fix: Handle single input case
This commit is contained in:
@@ -244,9 +244,12 @@ export class BlockSvg
|
||||
|
||||
private computeAriaLabel(): string {
|
||||
const {commaSeparatedSummary, inputCount} = buildBlockSummary(this);
|
||||
const inputSummary = inputCount
|
||||
? ` ${inputCount} ${inputCount > 1 ? 'inputs' : 'input'}`
|
||||
: '';
|
||||
let inputSummary = '';
|
||||
if (inputCount > 1) {
|
||||
inputSummary = 'has inputs';
|
||||
} else if (inputCount === 1) {
|
||||
inputSummary = 'has input';
|
||||
}
|
||||
|
||||
let blockTypeText = 'block';
|
||||
if (this.isShadow()) {
|
||||
@@ -288,7 +291,7 @@ export class BlockSvg
|
||||
|
||||
let additionalInfo = blockTypeText;
|
||||
if (inputSummary) {
|
||||
additionalInfo = `${additionalInfo} with ${inputSummary}`;
|
||||
additionalInfo = `${additionalInfo}, ${inputSummary}`;
|
||||
}
|
||||
|
||||
return prefix + commaSeparatedSummary + ', ' + additionalInfo;
|
||||
|
||||
Reference in New Issue
Block a user