Skip to content

Commit

Permalink
Merge pull request #785 from mathuo/782-dockview-fails-or-crashes-whe…
Browse files Browse the repository at this point in the history
…n-attempting-to-make-a-floating-group-from-a-popout-group

bug: wrong event ordering
  • Loading branch information
mathuo authored Dec 9, 2024
2 parents ede5a58 + 56bdec8 commit 32e759e
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions packages/dockview-core/src/dockview/dockviewComponent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -673,20 +673,23 @@ export class DockviewComponent
const isGroupAddedToDom =
referenceGroup.element.parentElement !== null;

const group = !isGroupAddedToDom
? referenceGroup
: options?.overridePopoutGroup ??
this.createGroup({ id: groupId });
let group: DockviewGroupPanel;

if (!isGroupAddedToDom) {
group = referenceGroup;
} else if (options?.overridePopoutGroup) {
group = options.overridePopoutGroup;
} else {
group = this.createGroup({ id: groupId });
this._onDidAddGroup.fire(group);
}

group.model.renderContainer = overlayRenderContainer;
group.layout(
_window.window!.innerWidth,
_window.window!.innerHeight
);

if (!this._groups.has(group.api.id)) {
this._onDidAddGroup.fire(group);
}

if (!options?.overridePopoutGroup && isGroupAddedToDom) {
if (itemToPopout instanceof DockviewPanel) {
this.movingLock(() => {
Expand Down

0 comments on commit 32e759e

Please sign in to comment.