Skip to content

Commit ed25759

Browse files
authored
Fix bad option check (microsoft#54435)
1 parent 9bd319b commit ed25759

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

src/vs/base/browser/ui/selectBox/selectBoxNative.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import { isMacintosh } from 'vs/base/common/platform';
1414
export class SelectBoxNative implements ISelectBoxDelegate {
1515

1616
private selectElement: HTMLSelectElement;
17+
private selectBoxOptions: ISelectBoxOptions;
1718
private options: string[];
1819
private selected: number;
1920
private readonly _onDidSelect: Emitter<ISelectData>;
@@ -23,12 +24,13 @@ export class SelectBoxNative implements ISelectBoxDelegate {
2324
constructor(options: string[], selected: number, styles: ISelectBoxStyles, selectBoxOptions?: ISelectBoxOptions) {
2425

2526
this.toDispose = [];
27+
this.selectBoxOptions = selectBoxOptions || Object.create(null);
2628

2729
this.selectElement = document.createElement('select');
2830
this.selectElement.className = 'monaco-select-box';
2931

30-
if (typeof selectBoxOptions.ariaLabel === 'string') {
31-
this.selectElement.setAttribute('aria-label', selectBoxOptions.ariaLabel);
32+
if (typeof this.selectBoxOptions.ariaLabel === 'string') {
33+
this.selectElement.setAttribute('aria-label', this.selectBoxOptions.ariaLabel);
3234
}
3335

3436
this._onDidSelect = new Emitter<ISelectData>();

0 commit comments

Comments
 (0)