mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-03 17:23:42 -05:00
allow nothing is selected as initial state (#22260)
This commit is contained in:
@@ -282,6 +282,21 @@ export abstract class ObjectManagementDialogBase<ObjectInfoType extends ObjectMa
|
||||
return table;
|
||||
}
|
||||
|
||||
protected createDropdown(ariaLabel: string, values: string[], value: string, enabled: boolean = true, width: number = DefaultInputWidth): azdata.DropDownComponent {
|
||||
// Automatically add an empty item to the beginning of the list if the current value is not specified.
|
||||
// This is needed when no meaningful default value can be provided.
|
||||
if (!value) {
|
||||
values.unshift('');
|
||||
}
|
||||
return this.modelView.modelBuilder.dropDown().withProps({
|
||||
ariaLabel: ariaLabel,
|
||||
values: values,
|
||||
value: value,
|
||||
width: DefaultInputWidth,
|
||||
enabled: enabled
|
||||
}).component();
|
||||
}
|
||||
|
||||
protected removeItem(container: azdata.DivContainer | azdata.FlexContainer, item: azdata.Component): void {
|
||||
if (container.items.indexOf(item) !== -1) {
|
||||
container.removeItem(item);
|
||||
|
||||
Reference in New Issue
Block a user