mirror of
https://github.com/mathuo/dockview
synced 2025-05-04 10:38:24 +00:00
Merge pull request #502 from mathuo/501-ensure-group-is-active-after-being-maximized
bug: maximized group must be active
This commit is contained in:
commit
53de69a61a
@ -4554,4 +4554,46 @@ describe('dockviewComponent', () => {
|
|||||||
expect(dockview.panels.length).toBe(3);
|
expect(dockview.panels.length).toBe(3);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
describe('maximized group', () => {
|
||||||
|
test('that a maximzied group is set to active', () => {
|
||||||
|
const container = document.createElement('div');
|
||||||
|
|
||||||
|
const dockview = new DockviewComponent({
|
||||||
|
parentElement: container,
|
||||||
|
components: {
|
||||||
|
default: PanelContentPartTest,
|
||||||
|
},
|
||||||
|
tabComponents: {
|
||||||
|
test_tab_id: PanelTabPartTest,
|
||||||
|
},
|
||||||
|
orientation: Orientation.HORIZONTAL,
|
||||||
|
});
|
||||||
|
|
||||||
|
dockview.layout(1000, 500);
|
||||||
|
|
||||||
|
const panel1 = dockview.addPanel({
|
||||||
|
id: 'panel_1',
|
||||||
|
component: 'default',
|
||||||
|
});
|
||||||
|
|
||||||
|
const panel2 = dockview.addPanel({
|
||||||
|
id: 'panel_2',
|
||||||
|
component: 'default',
|
||||||
|
position: { direction: 'right' },
|
||||||
|
});
|
||||||
|
|
||||||
|
expect(panel1.api.isActive).toBeFalsy();
|
||||||
|
expect(panel1.group.api.isActive).toBeFalsy();
|
||||||
|
expect(panel2.api.isActive).toBeTruthy();
|
||||||
|
expect(panel2.group.api.isActive).toBeTruthy();
|
||||||
|
|
||||||
|
panel1.api.maximize();
|
||||||
|
|
||||||
|
expect(panel1.api.isActive).toBeTruthy();
|
||||||
|
expect(panel1.group.api.isActive).toBeTruthy();
|
||||||
|
expect(panel2.api.isActive).toBeFalsy();
|
||||||
|
expect(panel2.group.api.isActive).toBeFalsy();
|
||||||
|
});
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
@ -194,6 +194,7 @@ export abstract class BaseGrid<T extends IGridPanelView>
|
|||||||
|
|
||||||
maximizeGroup(panel: T): void {
|
maximizeGroup(panel: T): void {
|
||||||
this.gridview.maximizeView(panel);
|
this.gridview.maximizeView(panel);
|
||||||
|
this.doSetGroupActive(panel);
|
||||||
}
|
}
|
||||||
|
|
||||||
isMaximizedGroup(panel: T): boolean {
|
isMaximizedGroup(panel: T): boolean {
|
||||||
|
Loading…
Reference in New Issue
Block a user