diff --git a/packages/dockview-core/src/__tests__/dockview/dockviewComponent.spec.ts b/packages/dockview-core/src/__tests__/dockview/dockviewComponent.spec.ts index e1ea35cbd..01c650d4f 100644 --- a/packages/dockview-core/src/__tests__/dockview/dockviewComponent.spec.ts +++ b/packages/dockview-core/src/__tests__/dockview/dockviewComponent.spec.ts @@ -4872,7 +4872,7 @@ describe('dockviewComponent', () => { ); }); - test('basic', async () => { + test('deserailize popout with no reference group', async () => { jest.useRealTimers(); const container = document.createElement('div'); @@ -5021,6 +5021,49 @@ describe('dockviewComponent', () => { expect(panel3.api.location.type).toBe('grid'); }); + test('that panel is rendered when moving from popout to new group', async () => { + const container = document.createElement('div'); + + window.open = () => setupMockWindow(); + + const dockview = new DockviewComponent(container, { + createComponent(options) { + switch (options.name) { + case 'default': + return new PanelContentPartTest( + options.id, + options.name + ); + default: + throw new Error(`unsupported`); + } + }, + }); + + dockview.layout(1000, 500); + + const panel1 = dockview.addPanel({ + id: 'panel_1', + component: 'default', + }); + + const panel2 = dockview.addPanel({ + id: 'panel_2', + component: 'default', + }); + + await dockview.addPopoutGroup(panel2); + + panel2.api.moveTo({ group: panel1.api.group, position: 'right' }); + + // confirm panel is rendered on DOM + expect( + panel2.group.element.querySelectorAll( + '.dv-content-container > .testpanel-panel_2' + ).length + ).toBe(1); + }); + test('move popout group of 1 panel inside grid', async () => { const container = document.createElement('div'); diff --git a/packages/dockview-core/src/dockview/dockviewComponent.ts b/packages/dockview-core/src/dockview/dockviewComponent.ts index d0d1c39aa..17e3e4f9f 100644 --- a/packages/dockview-core/src/dockview/dockviewComponent.ts +++ b/packages/dockview-core/src/dockview/dockviewComponent.ts @@ -2114,9 +2114,7 @@ export class DockviewComponent const newGroup = this.createGroupAtLocation(targetLocation); this.movingLock(() => - newGroup.model.openPanel(removedPanel, { - skipSetActive: true, - }) + newGroup.model.openPanel(removedPanel) ); this.doSetGroupAndPanelActive(newGroup);