diff --git a/extensions/resource-deployment/src/ui/toolsAndEulaSettingsPage.ts b/extensions/resource-deployment/src/ui/toolsAndEulaSettingsPage.ts index 6ce67a62f4..20d038db92 100644 --- a/extensions/resource-deployment/src/ui/toolsAndEulaSettingsPage.ts +++ b/extensions/resource-deployment/src/ui/toolsAndEulaSettingsPage.ts @@ -198,19 +198,22 @@ export class ToolsAndEulaPage extends ResourceTypePage { }).component(); optionLabel.width = '150px'; + const optionSelectedValue = (this.wizard.toolsEulaPagePresets) ? this.wizard.toolsEulaPagePresets[index] : option.values[0]; const optionSelectBox = this.view.modelBuilder.dropDown().withProperties({ values: option.values, - value: (this.wizard.toolsEulaPagePresets) ? this.wizard.toolsEulaPagePresets[index] : option.values[0], + value: optionSelectedValue, width: '300px', ariaLabel: option.displayName }).component(); - resourceTypeOptions.push(option.values[0]); + resourceTypeOptions.push(optionSelectedValue); this.wizard.registerDisposable(optionSelectBox.onValueChanged(async () => { - resourceTypeOptions[index] = optionSelectBox.value; - this.wizard.provider = this.getCurrentProvider(); - await this.wizard.open(); + if (resourceTypeOptions[index].name !== (optionSelectBox.value).name) { + resourceTypeOptions[index] = optionSelectBox.value; + this.wizard.provider = this.getCurrentProvider(); + await this.wizard.open(); + } })); this._optionDropDownMap.set(option.name, optionSelectBox); diff --git a/src/sql/base/browser/ui/selectBox/selectBox.ts b/src/sql/base/browser/ui/selectBox/selectBox.ts index 36203b7265..05c9fb3e7e 100644 --- a/src/sql/base/browser/ui/selectBox/selectBox.ts +++ b/src/sql/base/browser/ui/selectBox/selectBox.ts @@ -197,6 +197,10 @@ export class SelectBox extends vsSelectBox { } public select(index: number): void { + let selectedOptionIndex = this._optionsDictionary.get(this._selectedOption); + if (selectedOptionIndex === index) { // Not generating an event if the same value is selected. + return; + } super.select(index); if (this._dialogOptions !== undefined) { this._selectedOption = this._dialogOptions[index]?.value;