Skip to content

Commit 728807f

Browse files
haok1402cccindyyylBojunLi03SenF1arielkwak
authored
Fix toggle functionality for widgets. (#7178)
Co-authored-by: cccindyyyl <[email protected]> Co-authored-by: Bojun Li <[email protected]> Co-authored-by: Sen Feng <[email protected]> Co-authored-by: Ariel Kwak <[email protected]> Co-authored-by: Jeremy Tuloup <[email protected]>
1 parent dbb489a commit 728807f

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

packages/application/src/panelhandler.ts

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -165,17 +165,20 @@ export class SidePanelHandler extends PanelHandler {
165165
* if there is no most recently used.
166166
*/
167167
expand(id?: string): void {
168-
if (this._currentWidget) {
169-
this.collapse();
170-
}
171168
if (id) {
172-
this.activate(id);
173-
} else {
174-
const visibleWidget = this.currentWidget;
175-
if (visibleWidget) {
176-
this._currentWidget = visibleWidget;
177-
this.activate(visibleWidget.id);
169+
if (this._currentWidget && this._currentWidget.id === id) {
170+
this.collapse();
171+
this.hide();
172+
} else {
173+
this.collapse();
174+
this.hide();
175+
this.activate(id);
176+
this.show();
178177
}
178+
} else if (this.currentWidget) {
179+
this._currentWidget = this.currentWidget;
180+
this.activate(this._currentWidget.id);
181+
this.show();
179182
}
180183
}
181184

0 commit comments

Comments
 (0)