mirror of
https://github.com/mathuo/dockview
synced 2025-02-02 14:35:46 +00:00
Merge pull request #804 from mathuo/803-popout-overlay-container-incorrect-for-floating-group-return
bug: fix overlay container for popout to floating
This commit is contained in:
commit
cd7984cb2b
@ -5052,8 +5052,13 @@ describe('dockviewComponent', () => {
|
|||||||
component: 'default',
|
component: 'default',
|
||||||
});
|
});
|
||||||
|
|
||||||
await dockview.addPopoutGroup(panel2);
|
const panel3 = dockview.addPanel({
|
||||||
|
id: 'panel_3',
|
||||||
|
component: 'default',
|
||||||
|
renderer: 'always',
|
||||||
|
});
|
||||||
|
|
||||||
|
await dockview.addPopoutGroup(panel2);
|
||||||
panel2.api.moveTo({ group: panel1.api.group, position: 'right' });
|
panel2.api.moveTo({ group: panel1.api.group, position: 'right' });
|
||||||
|
|
||||||
// confirm panel is rendered on DOM
|
// confirm panel is rendered on DOM
|
||||||
@ -5062,6 +5067,22 @@ describe('dockviewComponent', () => {
|
|||||||
'.dv-content-container > .testpanel-panel_2'
|
'.dv-content-container > .testpanel-panel_2'
|
||||||
).length
|
).length
|
||||||
).toBe(1);
|
).toBe(1);
|
||||||
|
|
||||||
|
await dockview.addPopoutGroup(panel3);
|
||||||
|
panel3.api.moveTo({ group: panel1.api.group, position: 'right' });
|
||||||
|
|
||||||
|
// confirm panel is rendered to always overlay container
|
||||||
|
expect(
|
||||||
|
dockview.element.querySelectorAll(
|
||||||
|
'.dv-render-overlay > .testpanel-panel_3'
|
||||||
|
).length
|
||||||
|
).toBe(1);
|
||||||
|
expect(
|
||||||
|
panel2.group.element.querySelectorAll(
|
||||||
|
'.dv-content-container > .testpanel-panel_3'
|
||||||
|
).length
|
||||||
|
).toBe(0);
|
||||||
|
expect(dockview.element);
|
||||||
});
|
});
|
||||||
|
|
||||||
test('move popout group of 1 panel inside grid', async () => {
|
test('move popout group of 1 panel inside grid', async () => {
|
||||||
|
@ -842,32 +842,31 @@ export class DockviewComponent
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
} else if (this.getPanel(group.id)) {
|
} else if (this.getPanel(group.id)) {
|
||||||
const removedGroup = group;
|
group.model.renderContainer =
|
||||||
|
this.overlayRenderContainer;
|
||||||
|
returnedGroup = group;
|
||||||
|
|
||||||
if (floatingBox) {
|
if (floatingBox) {
|
||||||
this.addFloatingGroup(removedGroup, {
|
this.addFloatingGroup(group, {
|
||||||
height: floatingBox.height,
|
height: floatingBox.height,
|
||||||
width: floatingBox.width,
|
width: floatingBox.width,
|
||||||
position: floatingBox,
|
position: floatingBox,
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
this.doRemoveGroup(removedGroup, {
|
this.doRemoveGroup(group, {
|
||||||
skipDispose: true,
|
skipDispose: true,
|
||||||
skipActive: true,
|
skipActive: true,
|
||||||
skipPopoutReturn: true,
|
skipPopoutReturn: true,
|
||||||
});
|
});
|
||||||
|
|
||||||
removedGroup.model.renderContainer =
|
group.model.location = { type: 'grid' };
|
||||||
this.overlayRenderContainer;
|
|
||||||
removedGroup.model.location = { type: 'grid' };
|
|
||||||
returnedGroup = removedGroup;
|
|
||||||
|
|
||||||
this.movingLock(() => {
|
this.movingLock(() => {
|
||||||
// suppress group add events since the group already exists
|
// suppress group add events since the group already exists
|
||||||
this.doAddGroup(removedGroup, [0]);
|
this.doAddGroup(group, [0]);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
this.doSetGroupAndPanelActive(removedGroup);
|
this.doSetGroupAndPanelActive(group);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
Loading…
Reference in New Issue
Block a user