mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-05 01:25:38 -05:00
Making Notebook to scroll to output area only when Notebook command is executed (#5893)
This commit is contained in:
@@ -33,14 +33,24 @@ export class OutputAreaComponent extends AngularDisposable implements OnInit {
|
||||
this._register(this.themeService.onDidColorThemeChange(this.updateTheme, this));
|
||||
this.updateTheme(this.themeService.getColorTheme());
|
||||
if (this.cellModel) {
|
||||
this._register(this.cellModel.onOutputsChanged(() => {
|
||||
this._register(this.cellModel.onOutputsChanged(e => {
|
||||
if (!(this._changeRef['destroyed'])) {
|
||||
this._changeRef.detectChanges();
|
||||
if (e && e.shouldScroll) {
|
||||
this.setFocusAndScroll(this.outputArea.nativeElement);
|
||||
}
|
||||
}
|
||||
}));
|
||||
}
|
||||
}
|
||||
|
||||
private setFocusAndScroll(node: HTMLElement): void {
|
||||
if (node) {
|
||||
node.focus();
|
||||
node.scrollIntoView({ behavior: 'smooth', block: 'nearest' });
|
||||
}
|
||||
}
|
||||
|
||||
@Input() set activeCellId(value: string) {
|
||||
this._activeCellId = value;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user