Skip to content

Commit

Permalink
Fix rending of quickpick buttons (#13342)
Browse files Browse the repository at this point in the history
Ensure that  the Theia specific wrapper for the MonacoQuickPickItem properly forwards assignments of the "buttons" property to the wrapped item.

Fixes #13076

Contributed on behalf of STMicroelectronics
  • Loading branch information
tortmayr authored Mar 13, 2024
1 parent 9ff0ced commit de1c9a9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
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

0 comments on commit de1c9a9

Please sign in to comment.