File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed
src/vs/platform/actionWidget/browser Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -48,7 +48,7 @@ export class ActionWidgetDropdown extends BaseDropdown {
4848 }
4949
5050 override show ( ) : void {
51- const actionBarActions = this . _options . actionBarActions ?? this . _options . actionBarActionProvider ?. getActions ( ) ?? [ ] ;
51+ let actionBarActions = this . _options . actionBarActions ?? this . _options . actionBarActionProvider ?. getActions ( ) ?? [ ] ;
5252 const actions = this . _options . actions ?? this . _options . actionProvider ?. getActions ( ) ?? [ ] ;
5353 const actionWidgetItems : IActionListItem < IActionWidgetDropdownAction > [ ] = [ ] ;
5454
@@ -105,10 +105,11 @@ export class ActionWidgetDropdown extends BaseDropdown {
105105
106106 const previouslyFocusedElement = getActiveElement ( ) ;
107107
108+
108109 const actionWidgetDelegate : IActionListDelegate < IActionWidgetDropdownAction > = {
109110 onSelect : ( action , preview ) => {
110- action . run ( ) ;
111111 this . actionWidgetService . hide ( ) ;
112+ action . run ( ) ;
112113 } ,
113114 onHide : ( ) => {
114115 if ( isHTMLElement ( previouslyFocusedElement ) ) {
@@ -117,6 +118,14 @@ export class ActionWidgetDropdown extends BaseDropdown {
117118 }
118119 } ;
119120
121+ actionBarActions = actionBarActions . map ( action => ( {
122+ ...action ,
123+ run : async ( ...args : any [ ] ) => {
124+ this . actionWidgetService . hide ( ) ;
125+ return action . run ( ...args ) ;
126+ }
127+ } ) ) ;
128+
120129 this . actionWidgetService . show < IActionWidgetDropdownAction > (
121130 this . _options . label ?? '' ,
122131 false ,
You can’t perform that action at this time.
0 commit comments