Skip to content

Commit b2a266a

Browse files
authored
fix: Remove count of child blocks from ARIA labels (#9503)
1 parent 38e30fa commit b2a266a

1 file changed

Lines changed: 1 addition & 24 deletions

File tree

core/block_svg.ts

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -248,22 +248,6 @@ export class BlockSvg
248248
? ` ${inputCount} ${inputCount > 1 ? 'inputs' : 'input'}`
249249
: '';
250250

251-
let currentBlock: BlockSvg | null = null;
252-
let nestedStatementBlockCount = 0;
253-
254-
for (const input of this.inputList) {
255-
if (
256-
input.connection &&
257-
input.connection.type === ConnectionType.NEXT_STATEMENT
258-
) {
259-
currentBlock = input.connection.targetBlock() as BlockSvg | null;
260-
while (currentBlock) {
261-
nestedStatementBlockCount++;
262-
currentBlock = currentBlock.getNextBlock();
263-
}
264-
}
265-
}
266-
267251
let blockTypeText = 'block';
268252
if (this.isShadow()) {
269253
blockTypeText = 'replaceable block';
@@ -299,15 +283,8 @@ export class BlockSvg
299283
}
300284

301285
let additionalInfo = blockTypeText;
302-
if (inputSummary && !nestedStatementBlockCount) {
286+
if (inputSummary) {
303287
additionalInfo = `${additionalInfo} with ${inputSummary}`;
304-
} else if (nestedStatementBlockCount) {
305-
const childBlockSummary = `${nestedStatementBlockCount} child ${nestedStatementBlockCount > 1 ? 'blocks' : 'block'}`;
306-
if (inputSummary) {
307-
additionalInfo = `${additionalInfo} with ${inputSummary} and ${childBlockSummary}`;
308-
} else {
309-
additionalInfo = `${additionalInfo} with ${childBlockSummary}`;
310-
}
311288
}
312289

313290
return prefix + blockSummary + ', ' + additionalInfo;

0 commit comments

Comments
 (0)