fix input element id (#23066)

This commit is contained in:
Alan Ren
2023-05-09 18:54:21 -07:00
committed by GitHub
parent 60a280042d
commit a2c30b0df8
2 changed files with 7 additions and 2 deletions

View File

@@ -75,7 +75,10 @@ export class InputBox extends vsInputBox implements AdsWidget {
if (this._sqlOptions.ariaDescription) {
this.inputElement.setAttribute('aria-description', this._sqlOptions.ariaDescription);
}
this.inputElement.id = id;
if (id !== undefined) {
this.inputElement.id = id;
}
}
public override style(styles: IInputBoxStyles): void {

View File

@@ -99,7 +99,9 @@ export class SelectBox extends vsSelectBox implements AdsWidget {
this.element = dom.append(container, $('.monaco-selectbox.idle'));
}
this.selectElement.id = id;
if (id !== undefined) {
this.selectElement.id = id;
}
this._selectBoxOptions = selectBoxOptions;
let focusTracker = dom.trackFocus(this.selectElement);
this._register(focusTracker);