Skip to content

Commit

Permalink
Hide kernel quick pick on focus out (#12220)
Browse files Browse the repository at this point in the history
  • Loading branch information
DonJayamanne committed Nov 30, 2022
1 parent d8b45d7 commit 8b2cb8e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,8 @@ export class NotebookKernelSourceSelector implements INotebookKernelSourceSelect
matchOnDescription: true,
matchOnDetail: true,
supportBackInFirstStep: true,
activeItem: undefined
activeItem: undefined,
ignoreFocusOut: false
});
return { quickPick, selection: selection as Promise<ConnectionQuickPickItem | QuickPickItem> };
};
Expand Down
9 changes: 7 additions & 2 deletions src/platform/common/utils/multiStepInput.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ export interface IQuickPickParameters<T extends QuickPickItem> {
supportBackInFirstStep?: boolean;
onDidTriggerItemButton?(e: QuickPickItemButtonEvent<T>): void;
onDidChangeItems?: Event<T[]>;
/**
* Whether to close the quick pick when the user clicks outside the quickpick.
*/
ignoreFocusOut?: boolean;
}

// eslint-disable-next-line @typescript-eslint/naming-convention
Expand Down Expand Up @@ -141,7 +145,8 @@ export class MultiStepInput<S> implements IMultiStepInput<S> {
onDidTriggerItemButton,
onDidTriggerButton,
supportBackInFirstStep,
onDidChangeItems
onDidChangeItems,
ignoreFocusOut
}: P): { quickPick: QuickPick<T>; selection: Promise<MultiStepInputQuickPicResponseType<T, P>> } {
const disposables: Disposable[] = [];
const deferred = createDeferred<MultiStepInputQuickPicResponseType<T, P>>();
Expand All @@ -150,7 +155,7 @@ export class MultiStepInput<S> implements IMultiStepInput<S> {
input.step = step;
input.totalSteps = totalSteps;
input.placeholder = placeholder;
input.ignoreFocusOut = true;
input.ignoreFocusOut = ignoreFocusOut ?? true;
input.items = items;
if (stopBusy) {
input.busy = startBusy ?? false;
Expand Down

0 comments on commit 8b2cb8e

Please sign in to comment.