mirror of
https://github.com/Microsoft/vscode
synced 2024-09-13 21:55:38 +00:00
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:
parent
da47f08b53
commit
627b85e605
|
@ -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(', ');
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue