Skip to content

Commit f64beed

Browse files
authored
don't layout notebook when not visible (microsoft#202392)
* don't layout notebook when not visible * only call this when hiding
1 parent 9204cd8 commit f64beed

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/vs/workbench/contrib/notebook/browser/notebookEditor.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,13 @@ export class NotebookEditor extends EditorPane implements INotebookEditorPane {
150150
return this._widget.value;
151151
}
152152

153+
override setVisible(visible: boolean, group?: IEditorGroup | undefined): void {
154+
super.setVisible(visible, group);
155+
if (!visible) {
156+
this._widget.value?.onWillHide();
157+
}
158+
}
159+
153160
protected override setEditorVisible(visible: boolean, group: IEditorGroup | undefined): void {
154161
super.setEditorVisible(visible, group);
155162
if (group) {
@@ -552,7 +559,9 @@ export class NotebookEditor extends EditorPane implements INotebookEditorPane {
552559
return;
553560
}
554561

555-
this._widget.value.layout(dimension, this._rootElement, position);
562+
if (this.isVisible()) {
563+
this._widget.value.layout(dimension, this._rootElement, position);
564+
}
556565
}
557566

558567
//#endregion

0 commit comments

Comments
 (0)