mirror of
https://github.com/mathuo/dockview
synced 2025-01-22 09:25:57 +00:00
Merge pull request #800 from mathuo/799-popout-group-new-group-rendering-bug
bug: popout group to new group rendering bug fix
This commit is contained in:
commit
e45d9e48e8
@ -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');
|
||||
|
||||
|
@ -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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user