diff --git a/src/vs/base/browser/ui/checkbox/checkbox.ts b/src/vs/base/browser/ui/checkbox/checkbox.ts index 31677c97384738d86ad571f2f8f498e1d051a22b..ec8942b2f580345ad71da2353c49d0ab3e0baf30 100644 --- a/src/vs/base/browser/ui/checkbox/checkbox.ts +++ b/src/vs/base/browser/ui/checkbox/checkbox.ts @@ -42,16 +42,14 @@ export class Checkbox extends Widget { this.domNode.setAttribute('aria-label', this._opts.title); this.onclick(this.domNode, (ev) => { - this._checked = !this._checked; - this.domNode.className = this._className(); + this.checked = !this._checked; this._opts.onChange(); ev.preventDefault(); }); this.onkeydown(this.domNode, (keyboardEvent) => { if (keyboardEvent.keyCode === KeyCode.Space || keyboardEvent.keyCode === KeyCode.Enter) { - this._checked = !this._checked; - this.domNode.className = this._className(); + this.checked = !this._checked; this._opts.onChange(); keyboardEvent.preventDefault(); return; diff --git a/src/vs/workbench/parts/debug/browser/breakpointWidget.ts b/src/vs/workbench/parts/debug/browser/breakpointWidget.ts index cf0518bb789fec3a98a3af5555fdf6ad872cc236..a78a162204aec13dd07e1adc93690db52690aca4 100644 --- a/src/vs/workbench/parts/debug/browser/breakpointWidget.ts +++ b/src/vs/workbench/parts/debug/browser/breakpointWidget.ts @@ -54,7 +54,8 @@ export class BreakpointWidget extends ZoneWidget { const inputBoxContainer = dom.append(container, $('.inputBoxContainer')); this.inputBox = new InputBox(inputBoxContainer, this.contextViewService, { - placeholder: nls.localize('breakpointWidgetPlaceholder', "Breakpoint on line {0} will only stop if this condition is true. 'Enter' to accept, 'esc' to cancel.", this.lineNumber) + placeholder: nls.localize('breakpointWidgetPlaceholder', "Breakpoint on line {0} will only stop if this condition is true. 'Enter' to accept, 'esc' to cancel.", this.lineNumber), + ariaLabel: nls.localize('breakpointWidgetAriaLabel', "Type the breakpoint condition for line {0}. The program will only stop here if this condition is true. Press Enter to accept or Escape to cancel.") }); this.toDispose.push(this.inputBox); diff --git a/src/vs/workbench/parts/debug/browser/debugViewer.ts b/src/vs/workbench/parts/debug/browser/debugViewer.ts index a72e7d5ae20b65a429f112c277fc6ae16aae1d00..c549c92cf8bd907f131b8ece7dc33847b3ff4ee4 100644 --- a/src/vs/workbench/parts/debug/browser/debugViewer.ts +++ b/src/vs/workbench/parts/debug/browser/debugViewer.ts @@ -73,14 +73,15 @@ export function renderVariable(tree: tree.ITree, variable: model.Variable, data: } } -function renderRenameBox(debugService: debug.IDebugService, contextViewService: IContextViewService, tree: tree.ITree, element: any, container: HTMLElement, placeholder: string): void { +function renderRenameBox(debugService: debug.IDebugService, contextViewService: IContextViewService, tree: tree.ITree, element: any, container: HTMLElement, placeholder: string, ariaLabel: string): void { let inputBoxContainer = dom.append(container, $('.inputBoxContainer')); let inputBox = new inputbox.InputBox(inputBoxContainer, contextViewService, { validationOptions: { validation: null, showMessage: false }, - placeholder: placeholder + placeholder: placeholder, + ariaLabel: ariaLabel }); inputBox.value = element.name ? element.name : ''; @@ -577,7 +578,7 @@ export class WatchExpressionsRenderer implements tree.IRenderer { private renderWatchExpression(tree: tree.ITree, watchExpression: debug.IExpression, data: IWatchExpressionTemplateData): void { let selectedExpression = this.debugService.getViewModel().getSelectedExpression(); if ((selectedExpression instanceof model.Expression && selectedExpression.getId() === watchExpression.getId()) || (watchExpression instanceof model.Expression && !watchExpression.name)) { - renderRenameBox(this.debugService, this.contextViewService, tree, watchExpression, data.expression, nls.localize('watchExpressionPlaceholder', "Expression to watch")); + renderRenameBox(this.debugService, this.contextViewService, tree, watchExpression, data.expression, nls.localize('watchExpressionPlaceholder', "Expression to watch"), nls.localize('watchExpressionInputAriaLabel', "Type watch expression")); } data.actionBar.context = watchExpression; @@ -828,7 +829,7 @@ export class BreakpointsRenderer implements tree.IRenderer { private renderFunctionBreakpoint(tree: tree.ITree, functionBreakpoint: debug.IFunctionBreakpoint, data: IFunctionBreakpointTemplateData): void { if (!functionBreakpoint.name) { - renderRenameBox(this.debugService, this.contextViewService, tree, functionBreakpoint, data.breakpoint, nls.localize('functionBreakpointPlaceholder', "Function to break on")); + renderRenameBox(this.debugService, this.contextViewService, tree, functionBreakpoint, data.breakpoint, nls.localize('functionBreakpointPlaceholder', "Function to break on"), nls.localize('functionBreakPointInputAriaLabel', "Type function breakpoint")); } else { this.debugService.getModel().areBreakpointsActivated() ? tree.removeTraits('disabled', [functionBreakpoint]) : tree.addTraits('disabled', [functionBreakpoint]); data.name.textContent = functionBreakpoint.name; diff --git a/src/vs/workbench/parts/files/browser/views/explorerViewer.ts b/src/vs/workbench/parts/files/browser/views/explorerViewer.ts index 6c30cb53f92dc6509d8b40848dcd2fb34f23c30b..2541ed8e01ca7de806d397c7292aa384d432c449 100644 --- a/src/vs/workbench/parts/files/browser/views/explorerViewer.ts +++ b/src/vs/workbench/parts/files/browser/views/explorerViewer.ts @@ -285,12 +285,12 @@ export class FileRenderer extends ActionsRenderer implements IRenderer { } // Input field (when creating a new file or folder or renaming) - let inputBox = new InputBox(item.getHTMLElement(), this.contextViewService, { validationOptions: { validation: editableData.validator, showMessage: true - } + }, + ariaLabel: nls.localize('fileInputAriaLabel', "Type file name. Press Enter to confirm or Escape to cancel.") }); let value = stat.name || ''; diff --git a/src/vs/workbench/parts/git/browser/gitActionItems.ts b/src/vs/workbench/parts/git/browser/gitActionItems.ts index 1e5d91df9ebd84136f0f7a61c42088e0e32220f5..fb8611828a1b65cffe8a524fa39c34410447aca8 100644 --- a/src/vs/workbench/parts/git/browser/gitActionItems.ts +++ b/src/vs/workbench/parts/git/browser/gitActionItems.ts @@ -37,7 +37,8 @@ export class CreateBranchActionItem extends ActionBar.BaseActionItem { validationOptions: { showMessage: false, validation: v => this.validate(v) - } + }, + ariaLabel: nls.localize('newBranchAriaLabel', "Type branch name") }); $(this.inputBox.inputElement).on('keyup', (e: KeyboardEvent) => this.onKeyUp(e)); diff --git a/src/vs/workbench/parts/git/browser/views/changes/changesView.ts b/src/vs/workbench/parts/git/browser/views/changes/changesView.ts index 0d1e1162cd2e8a99fa2709e811bc04f89c98c1f8..bbce07bea4f427a7724159fdc652404d914da527 100644 --- a/src/vs/workbench/parts/git/browser/views/changes/changesView.ts +++ b/src/vs/workbench/parts/git/browser/views/changes/changesView.ts @@ -135,6 +135,7 @@ export class ChangesView extends EventEmitter.EventEmitter implements GitView.IV showMessage: true, validation: (): InputBox.IMessage => null }, + ariaLabel: nls.localize('commitMessageAriaLabel', "Type commit message (press {0} to commit)", ChangesView.COMMIT_KEYBINDING), flexibleHeight: true }); diff --git a/src/vs/workbench/parts/search/browser/searchViewlet.ts b/src/vs/workbench/parts/search/browser/searchViewlet.ts index cf2727f4d59ef34ea98974e28e5de153dd83da6c..ed1996bfb8675db39ec951c374ca6059bca28988 100644 --- a/src/vs/workbench/parts/search/browser/searchViewlet.ts +++ b/src/vs/workbench/parts/search/browser/searchViewlet.ts @@ -307,7 +307,6 @@ export class RefreshAction extends Action { } } - export class SelectOrRemoveAction extends Action { private selectMode: boolean; @@ -431,7 +430,7 @@ interface IOptions { placeholder?: string; width?: number; validation?: IInputValidator; - label?: string; + ariaLabel?: string; } class PatternInput { @@ -442,7 +441,7 @@ class PatternInput { private onOptionChange: (event: Event) => void; private width: number; private placeholder: string; - private label: string; + private ariaLabel: string; private listenersToRemove: any[]; private pattern: Checkbox; @@ -455,7 +454,7 @@ class PatternInput { this.onOptionChange = null; this.width = options.width || 100; this.placeholder = options.placeholder || ''; - this.label = options.label || nls.localize('defaultLabel', "input"); + this.ariaLabel = options.ariaLabel || nls.localize('defaultLabel', "input"); this.listenersToRemove = []; this.pattern = null; @@ -563,7 +562,7 @@ class PatternInput { this.inputBox = new InputBox(this.domNode, this.contextViewProvider, { placeholder: this.placeholder || '', - ariaLabel: this.label || '', + ariaLabel: this.ariaLabel || '', validationOptions: { validation: null, showMessage: true @@ -802,7 +801,7 @@ export class SearchViewlet extends Viewlet { builder.element('h4', { text: title }); this.inputPatternIncludes = new PatternInput(builder.getContainer(), this.contextViewService, { - label: nls.localize('label.includes', 'Includes') + ariaLabel: nls.localize('label.includes', 'Search Include Patterns') }); this.inputPatternIncludes.setIsGlobPattern(includesUsePattern); @@ -832,7 +831,7 @@ export class SearchViewlet extends Viewlet { builder.element('h4', { text: title }); this.inputPatternExclusions = new PatternInput(builder.getContainer(), this.contextViewService, { - label: nls.localize('label.excludes', 'Excludes') + ariaLabel: nls.localize('label.excludes', 'Search Exclude Patterns') }); this.inputPatternExclusions.setIsGlobPattern(exclusionsUsePattern); @@ -861,7 +860,8 @@ export class SearchViewlet extends Viewlet { builder.element('h4', { text: title }); this.inputPatternGlobalExclusions = new InputBox(builder.getContainer(), this.contextViewService, { - actions: [this.instantiationService.createInstance(ConfigureGlobalExclusionsAction)] + actions: [this.instantiationService.createInstance(ConfigureGlobalExclusionsAction)], + ariaLabel: nls.localize('label.global.excludes', 'Configured Search Exclude Patterns') }); this.inputPatternGlobalExclusions.inputElement.readOnly = true; $(this.inputPatternGlobalExclusions.inputElement).attr('aria-readonly', 'true');