Skip to content

Commit 627b85e

Browse files
committed
fix aria-label issue in kb editor
fixes A11y_GradeB_VSCode_Keyboard shortcut reads words together - Blind: Arrow key navigation to row Find the binding keys and "when" cell data are read together resulting in a word " CTRL + FeditorFocus instead of CTRL + F editorFocus" microsoft#182490
1 parent da47f08 commit 627b85e

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

src/vs/workbench/contrib/preferences/browser/keybindingsEditor.ts

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1187,13 +1187,18 @@ class AccessibilityProvider implements IListAccessibilityProvider<IKeybindingIte
11871187
return localize('keybindingsLabel', "Keybindings");
11881188
}
11891189

1190-
getAriaLabel(keybindingItemEntry: IKeybindingItemEntry): string {
1191-
let ariaLabel = keybindingItemEntry.keybindingItem.commandLabel ? keybindingItemEntry.keybindingItem.commandLabel : keybindingItemEntry.keybindingItem.command;
1192-
ariaLabel += ', ' + (keybindingItemEntry.keybindingItem.keybinding?.getAriaLabel() || localize('noKeybinding', "No Keybinding assigned."));
1193-
ariaLabel += ', ' + keybindingItemEntry.keybindingItem.when ? keybindingItemEntry.keybindingItem.when : localize('noWhen', "No when context.");
1194-
ariaLabel += ', ' + (isString(keybindingItemEntry.keybindingItem.source) ? keybindingItemEntry.keybindingItem.source : keybindingItemEntry.keybindingItem.source.description ?? keybindingItemEntry.keybindingItem.source.identifier.value);
1195-
ariaLabel += this.configurationService.getValue(AccessibilityVerbositySettingId.KeybindingsEditor) ? localize('keyboard shortcuts aria label', ", use space or enter to change the keybinding.") : '';
1196-
return ariaLabel;
1190+
getAriaLabel({ keybindingItem }: IKeybindingItemEntry): string {
1191+
const ariaLabel = [
1192+
keybindingItem.commandLabel ? keybindingItem.commandLabel : keybindingItem.command,
1193+
keybindingItem.keybinding?.getAriaLabel() || localize('noKeybinding', "No keybinding assigned"),
1194+
keybindingItem.when ? keybindingItem.when : localize('noWhen', "No when context"),
1195+
isString(keybindingItem.source) ? keybindingItem.source : keybindingItem.source.description ?? keybindingItem.source.identifier.value,
1196+
];
1197+
if (this.configurationService.getValue(AccessibilityVerbositySettingId.KeybindingsEditor)) {
1198+
const kbEditorAriaLabel = localize('keyboard shortcuts aria label', "use space or enter to change the keybinding.");
1199+
ariaLabel.push(kbEditorAriaLabel);
1200+
}
1201+
return ariaLabel.join(', ');
11971202
}
11981203
}
11991204

0 commit comments

Comments
 (0)