Merge from master

This commit is contained in:
Raj Musuku
2019-02-21 17:56:04 -08:00
parent 5a146e34fa
commit 666ae11639
11482 changed files with 119352 additions and 255574 deletions

View File

@@ -28,6 +28,13 @@ export class SelectBoxNative implements ISelectBoxDelegate {
this.selectBoxOptions = selectBoxOptions || Object.create(null);
this.selectElement = document.createElement('select');
// Workaround for Electron 2.x
// Native select should not require explicit role attribute, however, Electron 2.x
// incorrectly exposes select as menuItem which interferes with labeling and results
// in the unlabeled not been read. Electron 3 appears to fix.
this.selectElement.setAttribute('role', 'combobox');
this.selectElement.className = 'monaco-select-box';
if (typeof this.selectBoxOptions.ariaLabel === 'string') {
@@ -35,6 +42,7 @@ export class SelectBoxNative implements ISelectBoxDelegate {
}
this._onDidSelect = new Emitter<ISelectData>();
this.toDispose.push(this._onDidSelect);
this.styles = styles;
@@ -114,6 +122,10 @@ export class SelectBoxNative implements ISelectBoxDelegate {
this.selectElement.setAttribute('aria-label', label);
}
public setDetailsProvider(provider: any): void {
console.error('details are not available for native select boxes');
}
public focus(): void {
if (this.selectElement) {
this.selectElement.focus();
@@ -154,10 +166,10 @@ export class SelectBoxNative implements ISelectBoxDelegate {
}
private createOption(value: string, index: number, disabled?: boolean): HTMLOptionElement {
let option = document.createElement('option');
const option = document.createElement('option');
option.value = value;
option.text = value;
option.disabled = disabled;
option.disabled = !!disabled;
return option;
}