Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix rending of quickpick buttons #13342

Merged
merged 2 commits into from
Mar 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/core/src/common/quick-pick-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ export interface QuickPick<T extends QuickPickItemOrSeparator> extends QuickInpu
matchOnDescription: boolean;
matchOnDetail: boolean;
keepScrollPosition: boolean;
buttons: ReadonlyArray<QuickInputButton>;
readonly onDidAccept: Event<{ inBackground: boolean } | undefined>;
readonly onDidChangeValue: Event<string>;
readonly onDidTriggerButton: Event<QuickInputButton>;
Expand Down
8 changes: 8 additions & 0 deletions packages/monaco/src/browser/monaco-quick-input-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -596,6 +596,14 @@ class MonacoQuickPick<T extends QuickPickItem> extends MonacoQuickInput implemen
});
}

get buttons(): ReadonlyArray<QuickInputButton> {
return this.wrapped.buttons as QuickInputButton[];
}

set buttons(buttons: ReadonlyArray<QuickInputButton>) {
this.wrapped.buttons = buttons;
}

set items(itemList: readonly (T | QuickPickSeparator)[]) {
// We need to store and apply the currently selected active items.
// Since monaco compares these items by reference equality, creating new wrapped items will unmark any active items.
Expand Down
Loading