Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not set the dockpanel as parent of the tabbar #606

Merged
merged 7 commits into from
Jul 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions packages/widgets/src/docklayout.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1128,9 +1128,8 @@ export class DockLayout extends Layout {
// Enforce necessary tab bar behavior.
tabBar.orientation = 'horizontal';

// Reparent and attach the tab bar to the parent if possible.
// Attach the tab bar to the parent if possible.
if (this.parent) {
tabBar.parent = this.parent;
this.attachWidget(tabBar);
}

Expand Down
10 changes: 10 additions & 0 deletions packages/widgets/tests/src/dockpanel.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,16 @@ describe('@lumino/widgets', () => {
let panel = new DockPanel();
expect(panel.hasClass('lm-DockPanel')).to.equal(true);
});

it('should not have tabbar as child', () => {
let panel = new DockPanel();
// Adding a widget in the dock panel adds the DOM of a TabBar, but the TabBar
// widget should not be a in the children list of the DockPanel widget.
panel.addWidget(new Widget());
for (const tabBar of panel.tabBars()) {
expect(panel.contains(tabBar)).to.be.false;
}
});
});

describe('#dispose()', () => {
Expand Down