mirror of
https://github.com/mathuo/dockview
synced 2025-05-01 17:18:27 +00:00
bug: maximized group must be active
This commit is contained in:
parent
de93234632
commit
6b2ed70a7c
@ -4554,4 +4554,46 @@ describe('dockviewComponent', () => {
|
||||
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 {
|
||||
this.gridview.maximizeView(panel);
|
||||
this.doSetGroupActive(panel);
|
||||
}
|
||||
|
||||
isMaximizedGroup(panel: T): boolean {
|
||||
|
Loading…
Reference in New Issue
Block a user