Skip to content

Commit 4fa435b

Browse files
committed
Show OK by default for multi-select (fixes microsoft#90365)
1 parent 9ee247f commit 4fa435b

2 files changed

Lines changed: 5 additions & 4 deletions

File tree

src/vs/base/parts/quickinput/browser/quickInput.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,7 @@ class QuickPick<T extends IQuickPickItem> extends QuickInput implements IQuickPi
397397
private _valueSelection: Readonly<[number, number]> | undefined;
398398
private valueSelectionUpdated = true;
399399
private _validationMessage: string | undefined;
400-
private _ok = false;
400+
private _ok: boolean | 'default' = 'default';
401401
private _customButton = false;
402402
private _customButtonLabel: string | undefined;
403403
private _customButtonHover: string | undefined;
@@ -566,7 +566,7 @@ class QuickPick<T extends IQuickPickItem> extends QuickInput implements IQuickPi
566566
return this._ok;
567567
}
568568

569-
set ok(showOkButton: boolean) {
569+
set ok(showOkButton: boolean | 'default') {
570570
this._ok = showOkButton;
571571
this.update();
572572
}
@@ -757,7 +757,8 @@ class QuickPick<T extends IQuickPickItem> extends QuickInput implements IQuickPi
757757
if (!this.visible) {
758758
return;
759759
}
760-
this.ui.setVisibilities(this.canSelectMany ? { title: !!this.title || !!this.step, description: !!this.description, checkAll: true, inputBox: true, visibleCount: true, count: true, ok: this.ok, list: true, message: !!this.validationMessage, customButton: this.customButton } : { title: !!this.title || !!this.step, description: !!this.description, inputBox: true, visibleCount: true, list: true, message: !!this.validationMessage, customButton: this.customButton, ok: this.ok });
760+
const ok = this.ok === 'default' ? this.canSelectMany : this.ok;
761+
this.ui.setVisibilities(this.canSelectMany ? { title: !!this.title || !!this.step, description: !!this.description, checkAll: true, inputBox: true, visibleCount: true, count: true, ok, list: true, message: !!this.validationMessage, customButton: this.customButton } : { title: !!this.title || !!this.step, description: !!this.description, inputBox: true, visibleCount: true, list: true, message: !!this.validationMessage, customButton: this.customButton, ok });
761762
super.update();
762763
if (this.ui.inputBox.value !== this.value) {
763764
this.ui.inputBox.value = this.value;

src/vs/base/parts/quickinput/common/quickInput.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ export interface IQuickPick<T extends IQuickPickItem> extends IQuickInput {
162162

163163
readonly onDidAccept: Event<void>;
164164

165-
ok: boolean;
165+
ok: boolean | 'default';
166166

167167
readonly onDidCustom: Event<void>;
168168

0 commit comments

Comments
 (0)