Editor focus based on activeCell, create text in edit, scroll to active (#3725)

This commit is contained in:
Chris LaFreniere
2019-01-14 16:39:36 -08:00
committed by GitHub
parent 1fa03b5c74
commit 6dc4096299
4 changed files with 37 additions and 6 deletions

View File

@@ -250,8 +250,9 @@ export class NotebookComponent extends AngularDisposable implements OnInit, OnDe
this.updateToolbarComponents(this._model.trustedMode);
this._modelRegisteredDeferred.resolve(this._model);
model.backgroundStartSession();
// Set first cell as default active cell
if (this._model && this._model.cells && this._model.cells[0]) {
// Set first cell as default active cell if user creates new notebook
// Otherwise, don't select any cells by default
if (this._model && this._model.cells && this._model.cells[0] && this._model.isNewNotebook) {
this.selectCell(model.cells[0]);
}
this._changeRef.detectChanges();