diff --git a/packages/dockview-core/src/dockview/dockviewComponent.ts b/packages/dockview-core/src/dockview/dockviewComponent.ts index d83ed7923..3ff0f2cca 100644 --- a/packages/dockview-core/src/dockview/dockviewComponent.ts +++ b/packages/dockview-core/src/dockview/dockviewComponent.ts @@ -720,10 +720,13 @@ export class DockviewComponent return false; } - const referenceGroup = - itemToPopout instanceof DockviewPanel - ? itemToPopout.group - : itemToPopout; + const referenceGroup = options?.referenceGroup + ? options.referenceGroup + : itemToPopout instanceof DockviewPanel + ? itemToPopout.group + : itemToPopout; + + const referenceLocation = itemToPopout.api.location.type; /** * The group that is being added doesn't already exist within the DOM, the most likely occurrence @@ -740,6 +743,7 @@ export class DockviewComponent group = options.overridePopoutGroup; } else { group = this.createGroup({ id: groupId }); + if (popoutContainer) { this._onDidAddGroup.fire(group); } @@ -777,8 +781,6 @@ export class DockviewComponent this ); - const referenceLocation = itemToPopout.api.location.type; - group.model.renderContainer = overlayRenderContainer; group.layout( _window.window!.innerWidth,