Don't scroll when running code cell if in view (#5365)

This commit is contained in:
Chris LaFreniere
2019-05-06 11:36:06 -07:00
committed by Karl Burtram
parent f76500d5f0
commit f8da5bd1c7
2 changed files with 2 additions and 2 deletions

View File

@@ -306,7 +306,7 @@ export class CodeComponent extends AngularDisposable implements OnInit, OnChange
private setFocusAndScroll(): void {
if (this.cellModel.id === this._activeCellId) {
this._editor.focus();
this._editor.getContainer().scrollIntoView();
this._editor.getContainer().scrollIntoView({ behavior: 'smooth', block: 'nearest' });
}
}

View File

@@ -287,7 +287,7 @@ export class TextCellComponent extends CellView implements OnInit, AfterContentI
this.toggleEditMode(this.isActive());
if (this.output && this.output.nativeElement) {
(<HTMLElement>this.output.nativeElement).scrollTo();
(<HTMLElement>this.output.nativeElement).scrollTo({ behavior: 'smooth' });
}
}