Skip to content

Commit 017a4ce

Browse files
authored
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
1 parent 93f849d commit 017a4ce

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

core/block_svg.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -244,9 +244,12 @@ export class BlockSvg
244244

245245
private computeAriaLabel(): string {
246246
const {commaSeparatedSummary, inputCount} = buildBlockSummary(this);
247-
const inputSummary = inputCount
248-
? ` ${inputCount} ${inputCount > 1 ? 'inputs' : 'input'}`
249-
: '';
247+
let inputSummary = '';
248+
if (inputCount > 1) {
249+
inputSummary = 'has inputs';
250+
} else if (inputCount === 1) {
251+
inputSummary = 'has input';
252+
}
250253

251254
let blockTypeText = 'block';
252255
if (this.isShadow()) {
@@ -288,7 +291,7 @@ export class BlockSvg
288291

289292
let additionalInfo = blockTypeText;
290293
if (inputSummary) {
291-
additionalInfo = `${additionalInfo} with ${inputSummary}`;
294+
additionalInfo = `${additionalInfo}, ${inputSummary}`;
292295
}
293296

294297
return prefix + commaSeparatedSummary + ', ' + additionalInfo;

0 commit comments

Comments
 (0)