Fix #3734 Notebook cells are shown empty some times even when there is content (#3878)

- Editor layout gets called sometimes when other events happen (and Notebook isn't visible)
- Add in a layout call on re-setting input so the cell is updated. This fixes the problem by laying out once the UI is visible again.

Note: long term, should really be destroying the UI (while preserving the model), then restoring it including scroll selection etc. and hooking back up to the model. That is... much more work, but something we'll need long term to avoid issues where we have many Notebooks open at once. Not in scope for this PR
This commit is contained in:
Kevin Cunnane
2019-02-01 10:11:45 -08:00
committed by GitHub
parent 9504ede1f3
commit 5132e62045
8 changed files with 43 additions and 11 deletions

View File

@@ -142,6 +142,7 @@ export class CodeComponent extends AngularDisposable implements OnInit, OnChange
this.cellModel.source = this._editorModel.getValue();
this.onContentChanged.emit();
}));
this._register(this.model.layoutChanged(this.layout, this));
this.layout();
}