mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-23 01:25:38 -05:00
Merge from master
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user