From 0a674884479d5f7a33023b02ae7ea3c84b30710e Mon Sep 17 00:00:00 2001 From: Chris LaFreniere <40371649+chlafreniere@users.noreply.github.com> Date: Mon, 6 May 2019 11:36:06 -0700 Subject: [PATCH] Don't scroll when running code cell if in view (#5365) --- src/sql/workbench/parts/notebook/cellViews/code.component.ts | 2 +- .../workbench/parts/notebook/cellViews/textCell.component.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/sql/workbench/parts/notebook/cellViews/code.component.ts b/src/sql/workbench/parts/notebook/cellViews/code.component.ts index 5dd6d78646..f7743f29c7 100644 --- a/src/sql/workbench/parts/notebook/cellViews/code.component.ts +++ b/src/sql/workbench/parts/notebook/cellViews/code.component.ts @@ -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' }); } } diff --git a/src/sql/workbench/parts/notebook/cellViews/textCell.component.ts b/src/sql/workbench/parts/notebook/cellViews/textCell.component.ts index 9d9412efee..77e9fed623 100644 --- a/src/sql/workbench/parts/notebook/cellViews/textCell.component.ts +++ b/src/sql/workbench/parts/notebook/cellViews/textCell.component.ts @@ -287,7 +287,7 @@ export class TextCellComponent extends CellView implements OnInit, AfterContentI this.toggleEditMode(this.isActive()); if (this.output && this.output.nativeElement) { - (this.output.nativeElement).scrollTo(); + (this.output.nativeElement).scrollTo({ behavior: 'smooth' }); } }