@@ -41,7 +41,9 @@ export class QuickInputController extends Disposable {
41
41
42
42
private controller : IQuickInput | null = null ;
43
43
44
- private parentElement : HTMLElement ;
44
+ private _container : HTMLElement ;
45
+ get container ( ) { return this . _container ; }
46
+
45
47
private styles : IQuickInputStyles ;
46
48
47
49
private onShowEmitter = this . _register ( new Emitter < void > ( ) ) ;
@@ -54,10 +56,11 @@ export class QuickInputController extends Disposable {
54
56
55
57
constructor ( private options : IQuickInputOptions ,
56
58
private readonly themeService : IThemeService ,
57
- private readonly layoutService : ILayoutService ) {
59
+ private readonly layoutService : ILayoutService
60
+ ) {
58
61
super ( ) ;
59
62
this . idPrefix = options . idPrefix ;
60
- this . parentElement = options . container ;
63
+ this . _container = options . container ;
61
64
this . styles = options . styles ;
62
65
this . _register ( Event . runAndSubscribe ( dom . onDidRegisterWindow , ( { window, disposables } ) => this . registerKeyModsListeners ( window , disposables ) , { window : mainWindow , disposables : this . _store } ) ) ;
63
66
this . _register ( dom . onWillUnregisterWindow ( window => {
@@ -67,6 +70,7 @@ export class QuickInputController extends Disposable {
67
70
// existing parent to not loose functionality.
68
71
// (https://github.com/microsoft/vscode/issues/195870)
69
72
this . reparentUI ( this . layoutService . mainContainer ) ;
73
+ this . layout ( this . layoutService . mainContainerDimension , this . layoutService . mainContainerOffset . quickPickTop ) ;
70
74
}
71
75
} ) ) ;
72
76
}
@@ -87,15 +91,16 @@ export class QuickInputController extends Disposable {
87
91
// In order to support aux windows, re-parent the controller
88
92
// if the original event is from a different document
89
93
if ( showInActiveContainer ) {
90
- if ( this . parentElement . ownerDocument !== this . layoutService . activeContainer . ownerDocument ) {
94
+ if ( dom . getWindow ( this . _container ) !== dom . getWindow ( this . layoutService . activeContainer ) ) {
91
95
this . reparentUI ( this . layoutService . activeContainer ) ;
96
+ this . layout ( this . layoutService . activeContainerDimension , this . layoutService . activeContainerOffset . quickPickTop ) ;
92
97
}
93
98
}
94
99
95
100
return this . ui ;
96
101
}
97
102
98
- const container = dom . append ( this . parentElement , $ ( '.quick-input-widget.show-file-icons' ) ) ;
103
+ const container = dom . append ( this . _container , $ ( '.quick-input-widget.show-file-icons' ) ) ;
99
104
container . tabIndex = - 1 ;
100
105
container . style . display = 'none' ;
101
106
@@ -322,8 +327,8 @@ export class QuickInputController extends Disposable {
322
327
323
328
private reparentUI ( container : HTMLElement ) : void {
324
329
if ( this . ui ) {
325
- this . parentElement = container ;
326
- dom . append ( this . parentElement , this . ui . container ) ;
330
+ this . _container = container ;
331
+ dom . append ( this . _container , this . ui . container ) ;
327
332
}
328
333
}
329
334
0 commit comments