@@ -18,6 +18,7 @@ import { IContextViewService } from '../../contextview/browser/contextView.js';
18
18
import { IKeybindingService } from '../../keybinding/common/keybinding.js' ;
19
19
import { defaultListStyles } from '../../theme/browser/defaultStyles.js' ;
20
20
import { asCssVariable } from '../../theme/common/colorRegistry.js' ;
21
+ import { ILayoutService } from '../../layout/browser/layoutService.js' ;
21
22
22
23
export const acceptSelectedActionCommand = 'acceptSelectedCodeAction' ;
23
24
export const previewSelectedActionCommand = 'previewSelectedCodeAction' ;
@@ -182,10 +183,10 @@ export class ActionList<T> extends Disposable {
182
183
items : readonly IActionListItem < T > [ ] ,
183
184
private readonly _delegate : IActionListDelegate < T > ,
184
185
@IContextViewService private readonly _contextViewService : IContextViewService ,
185
- @IKeybindingService private readonly _keybindingService : IKeybindingService
186
+ @IKeybindingService private readonly _keybindingService : IKeybindingService ,
187
+ @ILayoutService private readonly _layoutService : ILayoutService ,
186
188
) {
187
189
super ( ) ;
188
-
189
190
this . domNode = document . createElement ( 'div' ) ;
190
191
this . domNode . classList . add ( 'actionList' ) ;
191
192
const virtualDelegate : IListVirtualDelegate < IActionListItem < T > > = {
@@ -270,7 +271,7 @@ export class ActionList<T> extends Disposable {
270
271
}
271
272
272
273
const maxVhPrecentage = 0.7 ;
273
- const height = Math . min ( heightWithHeaders , this . domNode . ownerDocument . body . clientHeight * maxVhPrecentage ) ;
274
+ const height = Math . min ( heightWithHeaders , this . _layoutService . mainContainerDimension . height * maxVhPrecentage ) ;
274
275
this . _list . layout ( height , maxWidth ) ;
275
276
276
277
this . domNode . style . height = `${ height } px` ;
0 commit comments