diff --git a/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellOutput.ts b/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellOutput.ts index e2b8ea102ab11..3c9df660a0c8b 100644 --- a/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellOutput.ts +++ b/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellOutput.ts @@ -466,9 +466,9 @@ export class CellOutputContainer extends CellContentPart { }); } - render(editorHeight: number) { + render() { if (this.viewCell.outputsViewModels.length > 0) { - if (this.viewCell.layoutInfo.totalHeight !== 0 && this.viewCell.layoutInfo.editorHeight > editorHeight) { + if (this.viewCell.layoutInfo.outputTotalHeight !== 0) { this.viewCell.updateOutputMinHeight(this.viewCell.layoutInfo.outputTotalHeight); this._relayoutCell(); } @@ -481,7 +481,6 @@ export class CellOutputContainer extends CellContentPart { entry.render(undefined); } - this.viewCell.editorHeight = editorHeight; if (this.viewCell.outputsViewModels.length > this.options.limit) { DOM.show(this.templateData.outputShowMoreContainer.domNode); this.viewCell.updateOutputShowMoreContainerHeight(46); @@ -491,7 +490,6 @@ export class CellOutputContainer extends CellContentPart { this._validateFinalOutputHeight(false); } else { // noop - this.viewCell.editorHeight = editorHeight; this._relayoutCell(); DOM.hide(this.templateData.outputContainer.domNode); } diff --git a/src/vs/workbench/contrib/notebook/browser/view/cellParts/codeCell.ts b/src/vs/workbench/contrib/notebook/browser/view/cellParts/codeCell.ts index 215ad0bdfe393..390a2e1da8656 100644 --- a/src/vs/workbench/contrib/notebook/browser/view/cellParts/codeCell.ts +++ b/src/vs/workbench/contrib/notebook/browser/view/cellParts/codeCell.ts @@ -57,6 +57,7 @@ export class CodeCell extends Disposable { this._outputContainerRenderer = this.instantiationService.createInstance(CellOutputContainer, notebookEditor, viewCell, templateData, { limit: 500 }); this.cellParts = this._register(templateData.cellParts.concatContentPart([cellEditorOptions, this._outputContainerRenderer])); + // this.viewCell.layoutInfo.editorHeight or estimation when this.viewCell.layoutInfo.editorHeight === 0 const editorHeight = this.calculateInitEditorHeight(); this.initializeEditor(editorHeight); @@ -112,7 +113,8 @@ export class CodeCell extends Disposable { this.updateForOutputFocus(); // Render Outputs - this._outputContainerRenderer.render(editorHeight); + this.viewCell.editorHeight = editorHeight; + this._outputContainerRenderer.render(); // Need to do this after the intial renderOutput if (this.viewCell.isOutputCollapsed === undefined && this.viewCell.isInputCollapsed === undefined) { this.initialViewUpdateExpanded();