Skip to content

Commit 469ee93

Browse files
authored
don't set quick pick items every time value changes (microsoft#165113)
1 parent 1b83b96 commit 469ee93

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

src/vs/platform/quickinput/browser/quickPickPin.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,13 @@ export async function showWithPinnedItems(storageService: IStorageService, stora
3030
}
3131
});
3232
quickPick.onDidChangeValue(async value => {
33-
// Return pinned items if there is no search value
34-
quickPick.items = value ? itemsWithoutPinned : itemsWithPinned;
33+
// If the items are pinnable (top level quick pick), update items such that
34+
// pinned are excluded from the search results
35+
if (quickPick.items.some(i => i.buttons?.some(b => b.iconClass === pinButtonClass))) {
36+
quickPick.items = value ? itemsWithoutPinned : itemsWithPinned;
37+
}
3538
});
39+
3640
quickPick.items = quickPick.value ? itemsWithoutPinned : itemsWithPinned;
3741
quickPick.show();
3842
}

src/vs/workbench/contrib/tasks/browser/taskQuickPick.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,8 +284,8 @@ export class TaskQuickPick extends Disposable {
284284
// Proceed to second level of quick pick
285285
if (selectedEntry && !selectedEntry.settingType && selectedEntry.task === null) {
286286
// The user has chosen to go back to the first level
287-
firstLevelTask = await this._doPickerFirstLevel(picker, (await this.getTopLevelEntries(defaultEntry)).entries);
288287
picker.value = '';
288+
firstLevelTask = await this._doPickerFirstLevel(picker, (await this.getTopLevelEntries(defaultEntry)).entries);
289289
} else if (selectedEntry && Types.isString(selectedEntry.settingType)) {
290290
picker.dispose();
291291
return this.handleSettingOption(selectedEntry.settingType);

0 commit comments

Comments
 (0)