fix: Refer to connections as positions in ARIA descriptions (#9509)

This commit is contained in:
Aaron Dodson
2025-12-04 08:25:57 -08:00
committed by GitHub
parent 80660bdf71
commit 0506479b5c

View File

@@ -335,7 +335,10 @@ export class RenderedConnection
if (highlightSvg) {
highlightSvg.style.display = '';
aria.setRole(highlightSvg, aria.Role.FIGURE);
aria.setState(highlightSvg, aria.State.ROLEDESCRIPTION, 'Connection');
const connectionType =
this.type === ConnectionType.INPUT_VALUE ? 'value' : 'statement';
const roleDescription = `${connectionType} block position`;
aria.setState(highlightSvg, aria.State.ROLEDESCRIPTION, roleDescription);
if (this.type === ConnectionType.NEXT_STATEMENT) {
const parentInput =
this.getParentInput() ??
@@ -359,7 +362,7 @@ export class RenderedConnection
`${this.getParentInput()?.getFieldRowLabel()}`,
);
} else {
aria.setState(highlightSvg, aria.State.LABEL, 'Open connection');
aria.setState(highlightSvg, aria.State.LABEL, 'Empty');
}
}
}