@@ -41,7 +41,9 @@ export class QuickInputController extends Disposable {
4141
4242 private controller : IQuickInput | null = null ;
4343
44- private parentElement : HTMLElement ;
44+ private _container : HTMLElement ;
45+ get container ( ) { return this . _container ; }
46+
4547 private styles : IQuickInputStyles ;
4648
4749 private onShowEmitter = this . _register ( new Emitter < void > ( ) ) ;
@@ -54,10 +56,11 @@ export class QuickInputController extends Disposable {
5456
5557 constructor ( private options : IQuickInputOptions ,
5658 private readonly themeService : IThemeService ,
57- private readonly layoutService : ILayoutService ) {
59+ private readonly layoutService : ILayoutService
60+ ) {
5861 super ( ) ;
5962 this . idPrefix = options . idPrefix ;
60- this . parentElement = options . container ;
63+ this . _container = options . container ;
6164 this . styles = options . styles ;
6265 this . _register ( Event . runAndSubscribe ( dom . onDidRegisterWindow , ( { window, disposables } ) => this . registerKeyModsListeners ( window , disposables ) , { window : mainWindow , disposables : this . _store } ) ) ;
6366 this . _register ( dom . onWillUnregisterWindow ( window => {
@@ -67,6 +70,7 @@ export class QuickInputController extends Disposable {
6770 // existing parent to not loose functionality.
6871 // (https://github.com/microsoft/vscode/issues/195870)
6972 this . reparentUI ( this . layoutService . mainContainer ) ;
73+ this . layout ( this . layoutService . mainContainerDimension , this . layoutService . mainContainerOffset . quickPickTop ) ;
7074 }
7175 } ) ) ;
7276 }
@@ -87,15 +91,16 @@ export class QuickInputController extends Disposable {
8791 // In order to support aux windows, re-parent the controller
8892 // if the original event is from a different document
8993 if ( showInActiveContainer ) {
90- if ( this . parentElement . ownerDocument !== this . layoutService . activeContainer . ownerDocument ) {
94+ if ( dom . getWindow ( this . _container ) !== dom . getWindow ( this . layoutService . activeContainer ) ) {
9195 this . reparentUI ( this . layoutService . activeContainer ) ;
96+ this . layout ( this . layoutService . activeContainerDimension , this . layoutService . activeContainerOffset . quickPickTop ) ;
9297 }
9398 }
9499
95100 return this . ui ;
96101 }
97102
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' ) ) ;
99104 container . tabIndex = - 1 ;
100105 container . style . display = 'none' ;
101106
@@ -322,8 +327,8 @@ export class QuickInputController extends Disposable {
322327
323328 private reparentUI ( container : HTMLElement ) : void {
324329 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 ) ;
327332 }
328333 }
329334
0 commit comments