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 GitHub
parent 022761aa4b
commit 0a67488447
2 changed files with 2 additions and 2 deletions

View File

@@ -308,7 +308,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' });
}
}