mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-03-17 11:03:14 -04:00
Use faster, editable dropdown for Collations in database dialogs (#23974)
* Also fixed an issue where a manually edited text field doesn't get updated when selecting the same dropdown value from before the manual edit. --------- Co-authored-by: Charles Gagnon <chgagnon@microsoft.com>
This commit is contained in:
@@ -27,7 +27,6 @@ export const DefaultTableListItemEnabledStateGetter: TableListItemEnabledStateGe
|
||||
export const DefaultTableListItemValueGetter: TableListItemValueGetter<any> = (item: any) => [item?.toString() ?? ''];
|
||||
export const DefaultTableListItemComparer: TableListItemComparer<any> = (item1: any, item2: any) => item1 === item2;
|
||||
|
||||
|
||||
export abstract class DialogBase<DialogResult> {
|
||||
protected readonly disposables: vscode.Disposable[] = [];
|
||||
protected readonly dialogObject: azdata.window.Dialog;
|
||||
@@ -287,7 +286,7 @@ export abstract class DialogBase<DialogResult> {
|
||||
return this.createButtonContainer([addButton, removeButton]);
|
||||
}
|
||||
|
||||
protected createDropdown(ariaLabel: string, handler: (newValue: string) => Promise<void>, values: string[], value: string | undefined, enabled: boolean = true, width: number = DefaultInputWidth): azdata.DropDownComponent {
|
||||
protected createDropdown(ariaLabel: string, handler: (newValue: string) => Promise<void>, values: string[], value: string | undefined, enabled: boolean = true, width: number = DefaultInputWidth, editable?: boolean, strictSelection?: boolean): 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.
|
||||
// Create a new array so that the original array isn't modified.
|
||||
@@ -301,7 +300,9 @@ export abstract class DialogBase<DialogResult> {
|
||||
values: dropdownValues,
|
||||
value: value,
|
||||
width: width,
|
||||
enabled: enabled
|
||||
enabled: enabled,
|
||||
editable: editable,
|
||||
strictSelection: strictSelection
|
||||
}).component();
|
||||
this.disposables.push(dropdown.onValueChanged(async () => {
|
||||
await handler(<string>dropdown.value!);
|
||||
|
||||
Reference in New Issue
Block a user