diff --git a/src/vs/base/browser/ui/dropdown/dropdown.ts b/src/vs/base/browser/ui/dropdown/dropdown.ts index b74cab78bb612..26b8a868320e7 100644 --- a/src/vs/base/browser/ui/dropdown/dropdown.ts +++ b/src/vs/base/browser/ui/dropdown/dropdown.ts @@ -206,8 +206,8 @@ export interface IActionProvider { export interface IDropdownMenuOptions extends IBaseDropdownOptions { contextMenuProvider: IContextMenuProvider; - actions?: IAction[]; - actionProvider?: IActionProvider; + readonly actions?: IAction[]; + readonly actionProvider?: IActionProvider; menuClassName?: string; menuAsChild?: boolean; // scope down for #99448 } diff --git a/src/vs/base/browser/ui/dropdown/dropdownActionViewItem.ts b/src/vs/base/browser/ui/dropdown/dropdownActionViewItem.ts index db045b26c13f3..407bc953562bb 100644 --- a/src/vs/base/browser/ui/dropdown/dropdownActionViewItem.ts +++ b/src/vs/base/browser/ui/dropdown/dropdownActionViewItem.ts @@ -78,19 +78,15 @@ export class DropdownMenuActionViewItem extends BaseActionViewItem { return null; }; + const isActionsArray = Array.isArray(this.menuActionsOrProvider); const options: IDropdownMenuOptions = { contextMenuProvider: this.contextMenuProvider, labelRenderer: labelRenderer, - menuAsChild: this.options.menuAsChild + menuAsChild: this.options.menuAsChild, + actions: isActionsArray ? this.menuActionsOrProvider as IAction[] : undefined, + actionProvider: isActionsArray ? undefined : this.menuActionsOrProvider as IActionProvider }; - // Render the DropdownMenu around a simple action to toggle it - if (Array.isArray(this.menuActionsOrProvider)) { - options.actions = this.menuActionsOrProvider; - } else { - options.actionProvider = this.menuActionsOrProvider as IActionProvider; - } - this.dropdownMenu = this._register(new DropdownMenu(container, options)); this._register(this.dropdownMenu.onDidChangeVisibility(visible => { this.element?.setAttribute('aria-expanded', `${visible}`); diff --git a/src/vs/workbench/browser/actions/layoutActions.ts b/src/vs/workbench/browser/actions/layoutActions.ts index 1e92e6c2f74bd..44e73f5ccb856 100644 --- a/src/vs/workbench/browser/actions/layoutActions.ts +++ b/src/vs/workbench/browser/actions/layoutActions.ts @@ -610,7 +610,12 @@ export class MoveViewAction extends Action { return new Promise((resolve, reject) => { quickPick.onDidAccept(() => { const viewId = quickPick.selectedItems[0]; - resolve(viewId.id); + if (viewId.id) { + resolve(viewId.id); + } else { + reject(); + } + quickPick.hide(); });