Skip to content

Commit

Permalink
Fix microsoft#158233. Cell output should not read editor height. (mic…
Browse files Browse the repository at this point in the history
  • Loading branch information
rebornix authored Dec 30, 2022
1 parent d8ce693 commit b98735c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand All @@ -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);
Expand All @@ -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);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit b98735c

Please sign in to comment.