mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -05:00
Fix select box event ordering (#13831)
* Fix select box event ordering * more fixes * Fix page * Revert typing change * Undo param * Fix compile error * Completely remove typings
This commit is contained in:
@@ -464,7 +464,7 @@ export class SchemaCompareDialog {
|
|||||||
}
|
}
|
||||||
).component();
|
).component();
|
||||||
this.sourceServerDropdown.onValueChanged(async (value) => {
|
this.sourceServerDropdown.onValueChanged(async (value) => {
|
||||||
if (this.sourceServerDropdown.values.findIndex(x => this.matchesValue(x, value)) === -1) {
|
if (this.sourceServerDropdown.values.findIndex(x => this.matchesValue(x, value as string)) === -1) {
|
||||||
await this.sourceDatabaseDropdown.updateProperties({
|
await this.sourceDatabaseDropdown.updateProperties({
|
||||||
values: [],
|
values: [],
|
||||||
value: ' '
|
value: ' '
|
||||||
@@ -493,7 +493,7 @@ export class SchemaCompareDialog {
|
|||||||
}
|
}
|
||||||
).component();
|
).component();
|
||||||
this.targetServerDropdown.onValueChanged(async (value) => {
|
this.targetServerDropdown.onValueChanged(async (value) => {
|
||||||
if (this.targetServerDropdown.values.findIndex(x => this.matchesValue(x, value)) === -1) {
|
if (this.targetServerDropdown.values.findIndex(x => this.matchesValue(x, value as string)) === -1) {
|
||||||
await this.targetDatabaseDropdown.updateProperties({
|
await this.targetDatabaseDropdown.updateProperties({
|
||||||
values: [],
|
values: [],
|
||||||
value: ' '
|
value: ' '
|
||||||
@@ -599,7 +599,7 @@ export class SchemaCompareDialog {
|
|||||||
}
|
}
|
||||||
).component();
|
).component();
|
||||||
this.sourceDatabaseDropdown.onValueChanged(async (value) => {
|
this.sourceDatabaseDropdown.onValueChanged(async (value) => {
|
||||||
this.sourceDbEditable = value;
|
this.sourceDbEditable = value as string;
|
||||||
this.dialog.okButton.enabled = await this.shouldEnableOkayButton();
|
this.dialog.okButton.enabled = await this.shouldEnableOkayButton();
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -618,7 +618,7 @@ export class SchemaCompareDialog {
|
|||||||
}
|
}
|
||||||
).component();
|
).component();
|
||||||
this.targetDatabaseDropdown.onValueChanged(async (value) => {
|
this.targetDatabaseDropdown.onValueChanged(async (value) => {
|
||||||
this.targetDbEditable = value;
|
this.targetDbEditable = value as string;
|
||||||
this.dialog.okButton.enabled = await this.shouldEnableOkayButton();
|
this.dialog.okButton.enabled = await this.shouldEnableOkayButton();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -81,8 +81,8 @@ export class SelectBox extends vsSelectBox {
|
|||||||
|
|
||||||
this._selectedOption = selectedOption;
|
this._selectedOption = selectedOption;
|
||||||
this._register(super.onDidSelect(newSelect => {
|
this._register(super.onDidSelect(newSelect => {
|
||||||
this._onDidSelect.fire(newSelect);
|
|
||||||
this.onSelect(newSelect);
|
this.onSelect(newSelect);
|
||||||
|
this._onDidSelect.fire(newSelect);
|
||||||
}));
|
}));
|
||||||
|
|
||||||
this.enabledSelectBackground = this.selectBackground;
|
this.enabledSelectBackground = this.selectBackground;
|
||||||
|
|||||||
@@ -80,7 +80,7 @@ export default class DropDownComponent extends ComponentBase<azdata.DropDownProp
|
|||||||
this._register(attachEditableDropdownStyler(this._editableDropdown, this.themeService));
|
this._register(attachEditableDropdownStyler(this._editableDropdown, this.themeService));
|
||||||
this._register(this._editableDropdown.onValueChange(async e => {
|
this._register(this._editableDropdown.onValueChange(async e => {
|
||||||
if (this.editable) {
|
if (this.editable) {
|
||||||
this.setSelectedValue(this._editableDropdown.value);
|
this.setSelectedValue(e);
|
||||||
await this.validate();
|
await this.validate();
|
||||||
this.fireEvent({
|
this.fireEvent({
|
||||||
eventType: ComponentEventType.onDidChange,
|
eventType: ComponentEventType.onDidChange,
|
||||||
@@ -97,8 +97,10 @@ export default class DropDownComponent extends ComponentBase<azdata.DropDownProp
|
|||||||
this._register(attachSelectBoxStyler(this._selectBox, this.themeService));
|
this._register(attachSelectBoxStyler(this._selectBox, this.themeService));
|
||||||
this._register(this._selectBox.onDidSelect(async e => {
|
this._register(this._selectBox.onDidSelect(async e => {
|
||||||
if (!this.editable) {
|
if (!this.editable) {
|
||||||
this.setSelectedValue(this._selectBox.value);
|
this.setSelectedValue(e.selected);
|
||||||
await this.validate();
|
await this.validate();
|
||||||
|
// This is currently sending the ISelectData as the args, but to change this now would be a breaking
|
||||||
|
// change for extensions using it. So while not ideal this should be left as is for the time being.
|
||||||
this.fireEvent({
|
this.fireEvent({
|
||||||
eventType: ComponentEventType.onDidChange,
|
eventType: ComponentEventType.onDidChange,
|
||||||
args: e
|
args: e
|
||||||
|
|||||||
Reference in New Issue
Block a user