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" #182490
This commit is contained in:
Ulugbek Abdullaev 2023-05-26 13:17:33 +02:00
parent da47f08b53
commit 627b85e605

View file

@ -1187,13 +1187,18 @@ class AccessibilityProvider implements IListAccessibilityProvider<IKeybindingIte
return localize('keybindingsLabel', "Keybindings");
}
getAriaLabel(keybindingItemEntry: IKeybindingItemEntry): string {
let ariaLabel = keybindingItemEntry.keybindingItem.commandLabel ? keybindingItemEntry.keybindingItem.commandLabel : keybindingItemEntry.keybindingItem.command;
ariaLabel += ', ' + (keybindingItemEntry.keybindingItem.keybinding?.getAriaLabel() || localize('noKeybinding', "No Keybinding assigned."));
ariaLabel += ', ' + keybindingItemEntry.keybindingItem.when ? keybindingItemEntry.keybindingItem.when : localize('noWhen', "No when context.");
ariaLabel += ', ' + (isString(keybindingItemEntry.keybindingItem.source) ? keybindingItemEntry.keybindingItem.source : keybindingItemEntry.keybindingItem.source.description ?? keybindingItemEntry.keybindingItem.source.identifier.value);
ariaLabel += this.configurationService.getValue(AccessibilityVerbositySettingId.KeybindingsEditor) ? localize('keyboard shortcuts aria label', ", use space or enter to change the keybinding.") : '';
return ariaLabel;
getAriaLabel({ keybindingItem }: IKeybindingItemEntry): string {
const ariaLabel = [
keybindingItem.commandLabel ? keybindingItem.commandLabel : keybindingItem.command,
keybindingItem.keybinding?.getAriaLabel() || localize('noKeybinding', "No keybinding assigned"),
keybindingItem.when ? keybindingItem.when : localize('noWhen', "No when context"),
isString(keybindingItem.source) ? keybindingItem.source : keybindingItem.source.description ?? keybindingItem.source.identifier.value,
];
if (this.configurationService.getValue(AccessibilityVerbositySettingId.KeybindingsEditor)) {
const kbEditorAriaLabel = localize('keyboard shortcuts aria label', "use space or enter to change the keybinding.");
ariaLabel.push(kbEditorAriaLabel);
}
return ariaLabel.join(', ');
}
}